How to set the order of SearchPane options
How to set the order of SearchPane options
Link to test case:
https://datatables.net/extensions/searchpanes/examples/initialisation/simple.html
Description of problem:
I am looking for a way to initialise SeacrhPanes ordered by the number of totals/results per option (not sure if I am using the right words here). Anyhow, given the example at https://datatables.net/extensions/searchpanes/examples/initialisation/simple.html, how would I achieve to order the "Position" pane descending, from "Software Engineer" with 6 results all the way down to "Technical Author" with 1 result. By default, the Pane seems to be sorted alphabetically by the name?
This question has an accepted answers - jump to answer
Answers
Any by "how would I achieve to order the "Position" pane descending", I mean programmatically, not by me pressing the button control in the pane ;-)
Solved by using this code
inside the https://datatables.net/reference/option/initComplete method
Clever . The other option would be to use the
searchPanes.dtOpts
parameter and set theorder
parameter to[[1, 'desc']]
.Allan