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

Hide Column Bug/Error

2 Answers 160 Views
Grid
This is a migrated thread and some comments may be shown as answers.
henzard
Top achievements
Rank 1
henzard asked on 01 Mar 2013, 06:35 AM
Hello there.
I'm developing a new site using kendo and noticed the following.

I have 3 identical grids(field wise) they store the "same type of" information according to the item selected in drop down list. There are 8 fields in the schema and 2 of those get hidden with the grid.hideColumn("id") function on all 3 grids. There is also a column that contain the edit/update and delete buttons fields.
Now the problem I encountered is the following. Each time I change the selection in the drop down list the kendo grid reloads the correct information but the columns keeps hiding, until all are hidden. (inspected with debugger and they get the "display: none" style attribute) even the ones that are not supposed to be hid. So maybe I am missing something in my code or there is and issue with the grid.hideColumn("id") function.
When for instance i don't include the columns in the definitions of the columns and comment out the grid.hideColumn("id") functions it works perfectly, i.e. keeps the columns as it should.

I've attached my source code below so i do hope you are able to replicate the issue and or tell me if I am using the function incorrectly.

Regards

2 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay Rusev
Telerik team
answered on 01 Mar 2013, 10:22 AM
Hello Henzard,

You are initializing Grid widgets over same dom elements multiple times. If you really need to do this you will have to destroy the grid widgets before hand. I.e you will have to add the following snippet inside UpdateGrid function.
var gridElemnts = $(".k-grid");
kendo.destroy(gridElemnts);
gridElemnts.empty();

You can find the updated sample attached to this thread.

Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
henzard
Top achievements
Rank 1
answered on 01 Mar 2013, 11:43 AM
I see. 

Thank you
Tags
Grid
Asked by
henzard
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
henzard
Top achievements
Rank 1
Share this question
or