Refer a cell by name
Refer a cell by name
uskerine
Posts: 33Questions: 15Answers: 0
Hi, in a table which includes the following definition:
"columnDefs": [
...
{
"name": "price",
"targets": [ 4 ],
"data": "price",
"render": function(data) {
return (data);
},
...
A cell is being currently refered by using:
oTable.cell(row,4).data();
Is there anyway to use its name ("price") instead of its position index (4)?
Thanks,
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Yes, the
column-selector
can be used to reference columns by name. In this case you would use:Allan
Thanks, that helps a lot to mantain code readable