Handson filters and column sorting

Tags: #<Tag:0x00007f8b1df979c8> #<Tag:0x00007f8b1df97888>

I’m using
columnSorting: true,
and filters: true

with my handson table. I’ve fetched all my records with a single api call.

The filtering and sorting only applies to what is currently displayed.

How would I sort & filter on all the data loaded by the api fetch?

Hi @merlin2049er

Can you please share code demo showing the issue? I can’t help much without seeing the data and the configuration.

Hi, here is my javascript for the handson table where I would like to filter and sort all records (not just the ones that are visible on the current page)

https://pastebin.com/PUMCYBHK

Hi @merlin2049er

Thank you for the code. I can see that you implemented your own pagination logic. Unfortunately, currently sorting and filtering isn’t supported on the data not visible in the current viewport, as pagination isn’t native Handsontable functionality.

Here you can check similar topic: Column Sorting with Pagination

ok I will check that out.

Is there a way to use the sorting controls, and change the default behavior? I’d like to reverse the response.data in memory and use those controls.

‘columnSorting: true,’

Hi @merlin2049er

If I understood correctly, in order to do this you would need to either, modify plugin in the core code, or write your own version of the plugin.

ok, would there be a way to add a link to a column header?

I possibly could create a link renderer for it and do the sorting on that.

Hi @merlin2049er

You can add link to the column headers with help of a afterGetColHeader hook. Here’s an example: https://jsfiddle.net/handsoncode/4odbqy7t/