Custom sorting with call to server
Custom sorting with call to server
I want to implement my own column sorting, which would involve fetching new data from the server.
This is what I want to do:
When a column header is clicked I want to know which column header has been clicked and whether ordering should be asc or desc (Basically the info I would get in $('#myTable').DataTable().order()
Then I want to want to make a call to an API and then render the table with the new data.
I know how I create the table, change the data etc. The question is merely about the sorting and how I can implement that in the best way.
Is it best to simply disable ordering of the columns, attach my own event listeners and handle the sorting icons myself?
Or is there another smart way of doing this?
I do not want to use serverside processing. I'm wrapping Datatables with Angular Datatables v0.5.x as I have an Angular app.