jQuery UI Widgets Forums Grid Sorting and Filtering in Pagination Virtual mode

This topic contains 2 replies, has 3 voices, and was last updated by  reven 1 year, 1 month ago.

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

  • Gowri
    Participant

    Hi,
    I would like to do sorting and filtering in pagination virtual mode. I found few samples were those sorting and filtering is happening on server side, but I would like to do in client side. i.e The record which is available in current page, I have to apply sorting and filtering.

    Example: I have grid with pagination virtual mode and total row count is 1000 and page count is 100. I would like to sort and filter on those 100 records in current page rather than 1000 records in server.

    Thanks in Advance.

    Regards,
    Gowri.


    Dimitar
    Participant

    Hi Gowri,

    Unfortunately, only server-side sorting and filtering can be used when virtual mode is enabled. There is no client-side solution.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/


    reven
    Participant

    This doesnt appear to be true. I managed to get this working via

    
          let rowData = null;
          this.jqxGrid.rendergridrows((obj) => {
            rowData = obj.data;
            return obj.data;
          });
          this.jqxGrid.onSort.subscribe((event) => {
            const col = event.args.sortinformation.sortcolumn;
            const descending = event.args.sortinformation.sortdirection.descending === true;
            rowData.sort((a, b) => {
              if (a[col] > b[col])
                return descending ? -1 : 1;
              else if (a[col] < b[col])
                return descending ? 1 : -1;
              return 0;
            });
          });

    This may have changed in the last 3 years. But this appears to be working for me.

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

You must be logged in to reply to this topic.