Closed mattpurlandncc closed 1 year ago
Currently I have to do the following to apply the sorting on load:
if (sort) {
if(sort.direction === 'asc') {
handler.sortAsc(sort.identifier);
} else {
handler.sortDesc(sort.identifier);
}
}
instead of the proposed:
if(sort) {
handler.sort(sort);
}
Ok. There's a new method handler.applySorting()
, that could fit with your use case.
Bellow are the params :
handler.applySorting({
orderBy: 'column_name',
direction: 'asc'
})
@vincjo any chance it can be 'identifier' instead of 'orderBy'? That way it matches that of getSorted() output
unfortunately, "identifier" = "orderBy.toString()", it can't be of type Function
"orderBy" can be a callback function, not "identifier"
I'm not sure if the title makes sense, but I'd like to be able to sort like the following:
This is the same format as getSorted() and would allow me to pass these via the URL to the backend:
http://localhost?sort[identifier]=column_name&sort[direction]=desc
Which could be sent as a prop to the frontend so I can sort the data on page load