jQWidgets Forums

jQuery UI Widgets Forums Grid On Refresh, filter is cleared but sort field is still seen

This topic contains 4 replies, has 2 voices, and was last updated by  mithilsrivastav 10 years, 5 months ago.

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

  • mithilsrivastav
    Participant

    Hi,

    For my grid, if I apply a filter on one column and sort on another column and press “refresh” button, my filter is cleared but my sort still persists.
    Steps:
    1. Apply a filter to your grid.
    2. Sort the grid by a column.
    3. Press Refresh button.
    Expected: Grid refreshes with filter and sort field getting cleared.
    Seen: Filter clears but sort still persists.

    Any pointers will be appreciated.

    Thanks,
    MIthil.


    Peter Stoev
    Keymaster

    Hi MIthil,

    I don’t know what kind of Refresh button you are writing about and what code you execute on click. If you want to clear filters and sorting, there are APIs for that. I would suggest you to look at the Grid’s API Documentation page.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    mithilsrivastav
    Participant

    Hi Peter,

    Apology for not defining the “Refresh” button in detail.

    Below mentioned are the properties that we use for the “Refresh” button on the grid:
    $(“#jqxgrid”).jqxGrid(“clearfilters”);
    $(‘#jqxgrid’).jqxGrid(‘clearselection’);
    $(“#jqxgrid”).jqxGrid(“removesort”);
    $(“#jqxgrid”).jqxGrid(“updatebounddata”);
    In this case, only filter gets cleared along with the selection but sorting persists.

    Please note the error for the same:
    Error: jqxGrid: The data is still loading. When the data binding is completed, the Grid raises the ‘bindingcomplete’ event. Call this function in the ‘bindingcomplete’ event handler.

    I tried putting remove sort for ‘bindingcomplete’ event handler as shown below but still sorting persists.
    $(“#jqxgrid”).on(“bindingComplete”, function () { $(“#jqxgrid”).jqxGrid(“removesort”); });

    Thanks and regards,
    Mithil.


    Peter Stoev
    Keymaster

    Hi Mithil,

    removesort works as expected in the current version. Example: http://jsfiddle.net/jqwidgets/Ufgs8/.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    mithilsrivastav
    Participant

    Hi Peter,

    If I remove sort individually, it works fine.
    This causes an issue when I try to remove filter and sort at the same time.

    Regards,
    Mithil.

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

You must be logged in to reply to this topic.