ColumnHide not working with row templates

6 posts, 0 answers
  1. Allocate Software Internal Systems
    Allocate Software Internal Systems avatar
    13 posts
    Member since:
    Jun 2010

    Posted 30 Jan 2014 Link to this post

    When using row templates, if you programatically hide a column and then apply sorting the hidden state is maintained on the headers but gets lost on the data row.

    Check out this fiddle showing the problem http://jsfiddle.net/Tups/3GWzZ/7/

    Am I doing something wrong or is this a bug?

    Thanks in advance.
  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 30 Jan 2014 Link to this post

    Hello,

    You will have to manage column cells state manually as the row template will be evaluated on very grid refresh. Here is an example how this can be implemented: http://jsfiddle.net/2yf9Q/

    Regards,
    Nikolay Rusev
    Telerik
    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. Allocate Software Internal Systems
    Allocate Software Internal Systems avatar
    13 posts
    Member since:
    Jun 2010

    Posted 31 Jan 2014 in reply to Nikolay Rusev Link to this post

    Thanks Nikolay.

    Is this by design or a work-around for a bug as it seems a bit of a hack and not ideal for us as our app has over 20 different grids that this would need to be added too.  Also it breaks when column re-ordering is switched on: http://jsfiddle.net/Tups/2yf9Q/1/

  5. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 03 Feb 2014 Link to this post

    Indeed this is by design. Developer must take care of the look & feel of the row template. In the matter of fact the row template redefines the whole concept of column cells in the row, i.e you can have only one cell.

    Same relates to column reordering: http://jsfiddle.net/hySAk/

    Regards,
    Nikolay Rusev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Allocate Software Internal Systems
    Allocate Software Internal Systems avatar
    13 posts
    Member since:
    Jun 2010

    Posted 05 Feb 2014 in reply to Nikolay Rusev Link to this post

    That makes sense.

    It would be very useful if there was some way to re-use or force the use of your mechanism for toggling/ordering cells in templated rows though, as our templates have the same cell structure that would be generated by your code.  As a result our implementation for toggling/ordering is a copy-paste of your solution into our code base which isn't ideal.
  7. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 06 Feb 2014 Link to this post

    Actually the mechanics behind column reorder/hiding is much more complicated :).  The only visible parts of all this is the column meta data: `hidden` attribute and the order in columns collection. And that is all developer needs to know and take care when implementing row template.

    Regards,
    Nikolay Rusev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready