This is a migrated thread and some comments may be shown as answers.

Load column settings from xml in kendo grid

6 Answers 310 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sag
Top achievements
Rank 1
Sag asked on 25 Oct 2018, 07:20 AM

Hi,

 

Is there any way that I can load the column settings of kendo grid using an XML. I will have the columns settings such as Column Name, width, visibility,order of display saved in a form of an XML some where in the configuration. User can manipulate the XML based on how he want to view the columns, so he has the complete command on which columns to display and in what order. There is always an option of reading the XML, form a Array of objects and assign it to "columns" property in the grid.

But is there any way that I can read that XML directly from a source and load or assign it to property so that my job gets easier?

 

Thanks,

Sag

6 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 29 Oct 2018, 07:18 AM
Hello Sag,

Parsing the XML data and passing the "columns" collection to the Grid (on initialization or within the setOptions method) is what could be used for achieving the desired behavior. The following article shows how to parse XML data to JavaScript array, which could be then used in the Grid's initialization:
And here is a link to the "setOptions" method of the Grid, which allows the settings of the Grid to be changed dynamically:
Hope this helps.


Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Sag
Top achievements
Rank 1
answered on 30 Oct 2018, 05:34 AM

Hi Dikov,

Thanks for your inputs and pointer for parsing xml to js objects.

Regards,

Sag

0
Sag
Top achievements
Rank 1
answered on 01 Nov 2018, 12:03 PM

Hi,

I implemented an autocomplete column in the grid with grouping enabled. Demo provided in the below

http://dojo.telerik.com/AkiDoheZ/3

When I try to group the grid by Product Name(which is an autocomplete column), after I drop the column header, UI is getting struck with busy indicator. Any ideas on how to enable grouping on columns that has autocomplete control?

Thanks in advance.

0
Accepted
Konstantin Dikov
Telerik team
answered on 05 Nov 2018, 07:45 AM
Hi Sag,

The column in question is bound to a complex object and grouping complex objects is not supported. In order for the grouping (sorting, filtering, etc.) to work you need to set the column to be bound to a property of the complex object:
{field:"Product.Name",title:"Product Name",editor: ProductNameAutoCompleteEditor, width: "130px", template: "#=Product.ProductName#"}],

Hope this helps.


Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Sag
Top achievements
Rank 1
answered on 05 Nov 2018, 08:41 AM

Hi Dikov,

Thanks for the reply. I thought to bind the column to a property of complex object as a work around but didn't think that that's the only solution. Anyway thanks for the help. I have another question though.

I tried to implement kendoSortable for one of the requirement. I am able to re-arrange the rows but I found an issue when I tried to include this feature. Please refer to below example.

http://dojo.telerik.com/aQIjuGAT

Issue repro steps:

1. Change "Unit Price" of any row.

2. Do not press Tab or do not click on the other column of same row. Instead directly click on any other row.

3. Previously changed value is gone.

If we Remove the kendoSortable functionality, everything works fine. So is this some kind of a product bug or is this a limitation of using kendoSortable feature?

0
Accepted
Konstantin Dikov
Telerik team
answered on 06 Nov 2018, 01:07 PM
Hello Sag,

The Batch editing relies on the blur event of the INPUT elements to apply the changes to the underlying dataItem, but when the Sortable widget is initialized over the Grid, the reordering of the DOM elements breaks the internal editing logic of the Grid. In order to overcome that issue you could follow the approach demonstrated in the following HowTo example:

Best Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Sag
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Sag
Top achievements
Rank 1
Share this question
or