How to ordering only current page

How to ordering only current page

hiepn06hiepn06 Posts: 1Questions: 1Answers: 0

i have a task using datatables, for each page of datatables has 20 records, i only need to sorting only current page, pls help me

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @hiepn06 ,

    That's not possible, I'm afraid, the sorting will always be across the table as a whole.

    Cheers,

    Colin

  • kthorngrenkthorngren Posts: 20,274Questions: 26Answers: 4,765

    It looks like you might be able to use the Absolute sorting plugin to make this work. In the example if you hold shift while clicking the Position column you can see that the rows the are absolutely sorted (Unknown in first column) are sorted independent of the remaining rows.

    I think you could do something similar and have your first ten rows with a specific keyword like Unknown or whatever you want and the reset with something else. You could hide this column with columns.visible and orderFixed to always order the table by this column.

    Kevin

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    @kthorngren - I messed around a bit with this - see here. It's looking good! Good call :)

This discussion has been closed.