Reputation: 1111
I am using Datatable plugin. I am fetching data from server side. Now I want to assign unique id to each row. How do I do that?
It would be better if I can assign id from client side(by setting any option or property of datatable I guess).
Thanks.
Upvotes: 0
Views: 1641
Reputation: 3832
You can do like
$('#myTable').DataTable( {
ajax: '/api/staff',
rowId: 'staffId'
} );
Here staffId
is property
from your data source.
Please check Document
Upvotes: 1