Can't search on createdCell content
Can't search on createdCell content
mornaistar
Posts: 1Questions: 1Answers: 0
i'm using createdCell to replace "I" or "A" results with some html and it works just great!
Now , if i search for "I" or "A" it works!
but is it possible to search for the content created by createdCell ?
My code:
{
"targets": 5,
createdCell: function (td, cellData, rowData, row, col) {
if ( rowData[5] === 'I' ) {
$(td).html('<span class="badge badge-danger">Inactive</a>');
}
if ( rowData[5] === 'A' ) {
$(td).html('<span class="badge badge-success">Active</a>');
}
}
},
I want to be able to search for "Active" and "Inactive" keywords.
This discussion has been closed.
Answers
Hi @mornaistar ,
The best bet here is orthogonal data. If you use
columns.render
instead ofcreatedCell
, then that will deal with the search and sorting.Cheers,
Colin