Get search data for select input
Get search data for select input
in DataTables
I have a table that has input fields in the cells, I have added the data-search attribute for the search text.
How do I get a unique list of the search text that references the data attribute.
this is what I have used in the past:
column.data().unique().sort().each(function (d, j)
{
});
This returns the entire inner html of the cell. But I need the <td data-search="ABC"> value ABC.
How can I reference that value from the column data and get a unique list of it.
This discussion has been closed.
Answers
The
dvariable has the data for the cell. You can use standard Javascript methods to parse theddata to get the value you want. If you need specific help please provide a simple test case with an example of your data so we can provid emore specific help.https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin