jQuery UI Widgets Forums Grid Keep the list sorted when page loads

This topic contains 1 reply, has 2 voices, and was last updated by  Yavor Dashev 2 years, 12 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Keep the list sorted when page loads #121406

    walker1234
    Participant

    Is there a way where I can keep the contents of jqxgrid sorted by one particular column when the page loads and records are displayed in the table? I am aware of sort ascending, sort descending and remove sort options that can be shown for that particular column. However, that is an option after the page has already loaded with the contents in the table. I am wondering how can I keep it sorted whenever page loads or is refreshed?

    Keep the list sorted when page loads #121407

    Yavor Dashev
    Participant

    Hi walker1234,

    You can save the sort information the browsers local storage and then reuse it when the page is loaded in order to achieve the functionality that you need.

    Quick code example:

      var localStorage = window.localStorage;
                $("#grid").on("sort", function (event) {
                    var sortinformation = event.args.sortinformation;
                  
                    localStorage.setItem('sortInfo', sortinformation);
                });

    Please, do not hesitate to contact us if you have any additional questions.

    Best Regards,
    Yavor Dashev
    jQWidgets team
    https://www.jqwidgets.com

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

You must be logged in to reply to this topic.