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

[Solved] Issue with grid state saving

1 Answer 102 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 19 Feb 2015, 05:34 AM
Hi,

I have been battling an issue in KendoUI's Grid widget recently. Basically I want to implement state saving for grids, this includes whether a field is hidden or not. I am able to get this working perfectly, except in the case where a field is initialized as "hidden:true".

What I can't work out, is that it seems to work fine in the kendo state save example here:
http://dojo.telerik.com/EBaDE

However, I tried modifying the kendo columnMenu example (I think is a closer match to my case), and I see the same issue as I am seeing in our internal application:
http://dojo.telerik.com/uJiNu/2

Basically the OrderId is set hidden:true, to begin with, now as soon as I get the grid options in the same way I normally would, set hidden:false, then set the grid options back, as you can see in my link above the column has room made for it, but it never appears. Now if you start to hide and show other columns, you get javascript errors.

Is this a Kendo Bug? Or am I doing something wrong? 

This took me a while to work out what was going on, any help would be much appreciated.


1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 20 Feb 2015, 12:33 PM

Hello Brian,

 

The correct way for showing a hidden column is to use the showColumn() method. This is needed, because the Grid needs to be resized correctly according to the newly added column. Here is an example:

http://dojo.telerik.com/@Kiril/ECELA

 

Regards,
Kiril Nikolov
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
Brian
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or