Setting a column type and using createdCell doesn't let column sort
Setting a column type and using createdCell doesn't let column sort
anag
Posts: 48Questions: 2Answers: 7
I've got the following object in columnDefs
the cell data is inserted with createdCell
the count is an integer. Sorting does not work when clicking the column header. I'm guessing because the cell data is added with createdCell.
"targets": 6,
"type": "num",
"createdCell": function (td, cellData, rowData, row, col) {
const count = cellData.length > 0 ? cellData.length : null;
$(td).html(count);
},
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I suspect you will want to use
columns.render
instead when trying to set the data of the column.Kevin