Hide Column Bug/Error

3 posts, 1 answers
  1. Henzard Kruger
    Henzard Kruger avatar
    5 posts
    Member since:
    Dec 2009

    Posted 01 Mar 2013 Link to this post

    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. Answer
    Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 01 Mar 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Henzard Kruger
    Henzard Kruger avatar
    5 posts
    Member since:
    Dec 2009

    Posted 01 Mar 2013 Link to this post

    I see. 

    Thank you
Back to Top