Data Search Update dont work

Data Search Update dont work

chiller20000chiller20000 Posts: 1Questions: 1Answers: 0

Hello,

I have a Problem with the update of the html5 attribute data-search.
I want to search my Datasets with special characters, which should not display in the Table directly.

Ich generate my Table with an Array of Data (not from HTML).
I update the row with the data-search Attribute after is created and invalidate the row. But that wont work.

productListDatatable = $('.productListTable').DataTable({
'columns': [
{ title: '#' },
{ title: '1' },
{ title: '2'},
{ title: '3' },
{ title: '4'},
{ title: '5' }
],
'createdRow': function(row, data){
var searchString = 'test';
$(row).find('td').first().attr('data-search', searchString);
productListDatatable.row(productListDatatable.row(row).index()).invalidate();
}
});
Then I add the Data:
productListDatatable.clear().rows.add(datatableProductsData).draw();

I already tried to invalidate after draw the table:
productListDatatable.clear().rows.add(datatableProductsData).draw().rows().invalidate();
But this doesn't work, too.

Hope someone can help me.

Regards

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @chiller20000 ,

    We're happy to take a look, but it would help, as per the forum rules, if you could link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.