Assign Row ID to Json Data

Assign Row ID to Json Data

peterwkcpeterwkc Posts: 21Questions: 0Answers: 0
edited March 2013 in General
Hello to all, I have few questions :

1. Does JQuery Data Table will automatically add a row id for each row data return server side in json array ?
2. If yes, how to retrieve the row id if have a delete button on the particular row ?
3. How to retrieve the data for the particular row base on row id ?

Please help.

Thanks.

Replies

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    > 1. Does JQuery Data Table will automatically add a row id for each row data return server side in json array ?

    Yes, if you use the `DT_RowId` property in the data source object for the row. DataTables will automatically add the row ID.

    > 2. If yes, how to retrieve the row id if have a delete button on the particular row ?

    `$(row).parents('tr').attr(id')` ?

    > 3. How to retrieve the data for the particular row base on row id ?

    Get the node using normal jQuery / DOM and then use fnGetData.

    Allan
This discussion has been closed.