About the rows select after order change
About the rows select after order change
cmansky
Posts: 9Questions: 4Answers: 0
I have a place to enter the begin and end to select the rows and the datatable is created with default order by created date asc. After I change the ordering to "created date desc" and keep using same number for selection, e.g. 0 to 1, the table is not select the first and second records, it selects the last two records.
Is possible to ignore the ordering and select the first two recorded?
This question has accepted answers - jump to:
Answers
Row selection is a property of the row, not its position. If a row is selected, it doesn't matter where it is in the table, it will remain selected.
If you need to only have the top two rows selected:
draw
event listenerrows().deselect()
method to deselect the rows that are currently selectedrow().select()
to select the top two rows.Allan
there is my code to control the selection
will select the first two rows. See the
row-selector
documentation for the full list of options that you can use for the row selector.Allan
Thanks you Allan!!!
finally i use "table_Usermanage.row(':eq('+i+')').select();"
is there any different with ":lt(2)"?
lt
is less than.eq
is equals. See the docs here.Allan
Thanks again!!!! I am a beginner in developing a website, it is helpful for me!!!