jQWidgets Forums

jQuery UI Widgets Forums Grid On set columns, grid keeps sort but lose filters?

Tagged: , ,

This topic contains 5 replies, has 2 voices, and was last updated by  Nicolas 11 years, 2 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author

  • Nicolas
    Participant

    Hi!

    In my app, I do a lot of get/set columns. Let say I want to add a new column to the grid, I get the columns array, I add a new column, and I set the array back in the grid.

    But I just found out that after setting the array back, the grid does render back the sorts, but not the filters.

    Here is an example : ‘firstname’ is filtered, and ‘lastname’ is sorted. Then, after clicking on ‘get and set columns’, ‘lastname’ keeps its sort, but ‘firstname’ lose its filter.
    http://jsfiddle.net/8H2bD/2/

    I would understand if both would work/not work at the same time. But why does one works when they other don’t?

    Regards!


    Peter Stoev
    Keymaster

    Thank you for the feedback! We will think whether to change or not the columns setter behavior in the future versions.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    Nicolas
    Participant

    I just took a deeper look at the jsFiddle (http://jsfiddle.net/8H2bD/2/), and I just found out that after clicking the ‘get set columns’ button, the column ‘firstname’ is still filtered! But, it lost the style (background and icon) that tells the user about the filtering. When in that state, the button ‘clear filter’ doesn’t work, but you can replace with a new filter.

    Can you see the same problem that I have here?

    Thank you for your great work! jqxGrid is a fantastic component!
    Regards!


    Peter Stoev
    Keymaster

    Hi Nicolas,

    Remove the sorting & filtering if you wish when you dynamically set the “columns” property.

            $("#jqxgrid").jqxGrid('clearfilters');
            $("#jqxgrid").jqxGrid('sortby', 'firstname', null);   
            $("#jqxgrid").jqxGrid('columns', columns);

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    Nicolas
    Participant

    Of course I could handle that on my side. I would totally understand if both sorting and filtering where lost when I set an array of columns (my array usually match the old one, but there might be new or deleted columns).

    But right now, sorting works fine, and the only problem is the filtered columns that lose their styles. I also tried calling “refreshfilterrow” and “applyfilters” after settings the columns, but it doesn’t seems to re-add the filter style.

    To me, this behavior looks inconsistent. Settings columns should keep or delete sorting/filtering, but not an halfway behavior. And right now, keeping it seems to works pretty well, apart for the filter style.


    Nicolas
    Participant

    Hi!

    I just retester my jsFiddle (http://jsfiddle.net/8H2bD/2/) to find out that with the new version, the sort and filters are remove when setting new columns. This is fine with me, as the behavior is now consistent. So I’ll handle resetting the sorts and filters on my side.

    Regards

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.