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

Kendo Grid Layout Saving Events

1 Answer 265 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 02 Mar 2016, 09:45 AM

Hi

I am implementing the Save Layout for the Kendo Grid and have a question about events.

I am currently using the following events to save changes to the layout.

                                    change: function(e) {
                                        saveGridLayout();
                                    },
                                    columnReorder: function(e) {
                                        saveGridLayout();
                                    },
                                    columnResize: function(e) {
                                        saveGridLayout();
                                    }

 

If I just use Column Reorder and Resize events then I get no issues with reloading the grid because neither of those events get called on load of the grid.  My issue is that I have to use the change event to catch grouping/filtering of the grid which I also want to save, but as this gets called on gird load the save gets called again before my load.

Can anyone explain to me the events I should use to catch changes to the gird, save the layout and then when reloading layout when to do that?

Regards

Mike

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimiter Madjarov
Telerik team
answered on 03 Mar 2016, 03:06 PM

Hello Mike,

I assume you are referring to the dataBound event of the Grid, which is fired on load. The change event is only fired when a Grid item is selected. Indeed you could use the dataBound event of the Grid to store the state, since it will be fired on sorting / filtering / grouping etc. Additionally a flag variable will be useful in the event handler to determine if the state should be saved or not. For example set it to false when the Grid is initially loading or the state is being restored and to true in the rest of the cases.

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or