add sclass based on data

add sclass based on data

jacobruvalcabajacobruvalcaba Posts: 10Questions: 6Answers: 0

Really simple question can I do something like this on columns
{ data: 'id' },
{ data: 'test','sClass': { data: 'id' }, },
..

This question has an accepted answers - jump to answer

Answers

  • jacobruvalcabajacobruvalcaba Posts: 10Questions: 6Answers: 0

    or another workaround so my class has the id?
    Thanks

  • allanallan Posts: 63,356Questions: 1Answers: 10,447 Site admin
    Answer ✓

    You can use the DT_RowClass property to have DataTables automatically add a class to a row (documentation - that page is about server-side processing, but the DT_RowId, etc, parameters will work for client-side processing as well).

    If you need the class to be added to a cell use columns.createdCell or rowCallback.

    Allan

  • jacobruvalcabajacobruvalcaba Posts: 10Questions: 6Answers: 0

    Thanks allan. Sorry for the late response

This discussion has been closed.