get render row index
get render row index
omerabbasi78
Posts: 17Questions: 7Answers: 1
Hi,
I want to get the index of row which is being rendered in columns. For example below code,
columns: [{
data: null,
className: "tab-1",
render: function (data, type, row) {
//I want to get row index here somehow
}
}];
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Like this?
@Dalex73 you are so helpful
Thanks a lot mate
i want to get row data in renderer function of responsive dataTable.
For example below code,
responsive: {
details: {
renderer: function ( api, rowIdx, columns , meta) {
var row = meta.row();
Hi @sein ,
You can do that in
responsive.details.renderer
with a combination ofrowIdx
andcolumns
, as shown in this example.Note Responsive isn't relevant to this thread, so please could you post future comments on a new thread.
Cheers,
Colin
Humm...
My problem is after removing a row, the index (meta.row) in "render" is outdated.
{ ...
"Data": "grade",
"render": function ( data, type, row, meta ) {
return "
<
div span=\"myDeleteRow('" + meta.row + "');\" </div>";
}
} ...
any suggestion ???
This post is a duplicate of this thread:
https://datatables.net/forums/discussion/52794/how-to-refresh-meta-row-after-deleting-a-row#latest
Kevin