You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.
Is it possible to re-apply any column sorting applied should the underlying data be changed? I'm applying custom filtering to the bound data which is returned via ajax. The returned data isn't necessarily ordered as per the applied column sorting.
The text was updated successfully, but these errors were encountered:
import { columns } from "svelte-simple-datatables/src/stores/columns.js";
import { data } from 'svelte-simple-datatables/src/stores/data.js'
...
function sortTable() {
// Filter to get current column used for sorting
let sortColumn = columns.get().find(column => column.classList.contains('asc') || column.classList.contains('desc'));
// Sort by current direction
if(sortColumn.classList.contains('asc')) {
data.sortAsc(sortColumn.key);
} else {
data.sortDesc(sortColumn.key);
}
}
I won't mark this as closed as I feel it'd be worth adding this functionality automatically
Is it possible to re-apply any column sorting applied should the underlying data be changed? I'm applying custom filtering to the bound data which is returned via ajax. The returned data isn't necessarily ordered as per the applied column sorting.
The text was updated successfully, but these errors were encountered: