data-* attributes with ajax data
data-* attributes with ajax data
briankates
Posts: 2Questions: 2Answers: 0
I have an ajax sourced data table that I want to append a data-search / data-filter attribute to. I can do that pretty easily with a row callback:
"createdRow": function ( row, data, index ) {
$('td', row).eq(1).attr("data-search", data.gameNum);
$('td', row).eq(1).attr("data-filter", data.gameNum);
}
What else do I have to do to get the search to pick up these fields?
Thanks.
This discussion has been closed.
Answers
I would suggest using
columns.render
as an object rather than trying to write to the DOM - that would add a roundtrip to the DOM that would be a performance hit on large tables.Have a look specifically at this section of the documentation.
Allan
Thanks. For now, I "solved" by adding a new, hidden column. Obviously not ideal. I'll look at the documentation.