How to change a column's "className" property?

How to change a column's "className" property?

tatsujintatsujin Posts: 3Questions: 2Answers: 1
edited February 2016 in Free community support

I can remove the class easily from the header and existing cells, but not new ones.

var col = table.column('something:name');
$(col.header()).removeClass('remove');
$(col.nodes()).removeClass('remove');

New rows will use the column definitions, so I want to change it... but how?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    There is no option to change the columns.className option after initialisation. Would you need to use createdRow or rowCallback to add the classes as you require.

  • tatsujintatsujin Posts: 3Questions: 2Answers: 1
    Answer ✓

    I see. Well, I think I'll solve it in another way, almost the opposite.
    Instead of adding the class to the column's definition I'll add the class on all existing cells in the column (and possibly in the column's renderer), which is then easy to remove the same way.

This discussion has been closed.