Add row ID to client side DataTables
Add row ID to client side DataTables
Hi,
Since my biggest table has 500 records i suppose client side is the better way to work with DataTables. I get my data through ajax and then load it as JSON data into DataTables. Which is working fine.
In this thread => http://datatables.net/forums/discussion/7460/how-do-i-add-a-row-id-to-each-dynamically-added-row-solved
Allan says that you can also add id's to the row for client side data.
But I don't get how that would be done... Could you point me this out?
Thanks!
This question has accepted answers - jump to:
Answers
I think you need to add the idsrc. This is what automatically applies the row ID to each row I believe.
https://editor.datatables.net/reference/option/idSrc
I can't get this to work when not using editor. Is there such an option for DataTables?
Or would you put it in a hidden column?
There is an example for how to do it in DataTables here: http://datatables.net/examples/server_side/ids.html .
The
DT_RowId
property is documented in the manual. It can be used for both client-side and server-side processing.Allan