Adding custom data attribute to each cell gotten from server request

Adding custom data attribute to each cell gotten from server request

spartyboyspartyboy Posts: 1Questions: 1Answers: 0

my data table uses server side request and i want to add custom attribute to every cell i.e (<td data-prop="the value for the properties returned from server array to generate the row tr">) ,whenever datatable creates the table. how can this be achieved

Answers

  • colincolin Posts: 15,146Questions: 1Answers: 2,586

    Hi @spartyboy ,

    You can do that in createdRow, there's a similar example in the manual page - it's showing how to add a class to the row, but it's trivial to add the property instead.

    Cheers,

    Colin

This discussion has been closed.