I want to show the selected rows first.
I want to show the selected rows first.
haidy717
Posts: 1Questions: 1Answers: 0
Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
Answers
The order of the rows shown is based on the sorting of the table. One option might be to have a hidden column, using
columns.visible
, and have it as the primary column to sort the table usingorderFixed
. If the row is selected then set the value of the column to 0 and if not selected set it to 1.How this would work is based on how you are selecting the rows now and your data structure. Here is a simple example using the Select extension. It uses the
select
anddeselect
events withrows().every()
to loop through all the rows that have been selected or deselected. It uses therow().data()
API to get and set the row data.https://live.datatables.net/dodobuge/27/edit
The example may need refactoring based on your specific solution.
Kevin