Get row id on datatable.row on each javascript
To get the row id on each DataTable row, you can use the each() function in jQuery to iterate through each row and retrieve its id attribute. Here's an example code snippet:
var table = $('#myDataTable').DataTable(); table.rows().every(function() { var data = this.data(); var rowId = $(this.node()).attr('id'); });
In the example above, myDataTable is the ID of the DataTable. rows().every() iterates through each row in the table, and $(this.node()).attr('id') retrieves the id attribute of the current row. You can replace console.log with your own code to handle each row.
Komentar
Posting Komentar