Adding data-* to
Adding data-* to
nhughes552
Posts: 7Questions: 2Answers: 0
Hi
Anyone have an example of how to add data-* Attributes to <td> elements?
Thanks
Nige
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
There are a couple examples found in the Examples page under Advanced. Is this what you are looking for
Kevin
Hi
Thanks for the quick response.
Looked at the example and it mentions it can detect four different attributes but as far as I can see the example does't show how to set them.
I would like to be able to add custom data-* attributes. There is a mention about using the columns.render (https://datatables.net//forums/discussion/comment/74121/#Comment_74121) but again not really a specific example and I'm still a bit of a novice!
The examples are shown in the HTML - look under the HTML tab on the examples page.
Ah I see in the example the table is created and **then **enhanced by datatables. I'm using ajax and datatables to create the table and want to add the attributes as datatables creates the table.
Use
createdRow
,columns.createdCell
orrowCallback
.Allan