need help for migrate fnFilter to
need help for migrate fnFilter to
Hello,
my project use the old instance of datatable with jquery object like:
oTable = $("#mydata").dataTable({
now I want to use the API with:
oTable = $("#mydata").DataTable({
I have to change several code and now I have a little problem with my old fnFilter function.
If a user has clicked into a row, this filter function was called and only this single row was displayed in the table.
The old was:
oTable .fnFilter("^"+ aData['unitynumber'] +"$", 0 , true,true,true);
I tried to chance this to:
regExSearch = '^\s' + aData['unitynumber'] +'\s*$';
oTable.columns().search(regExSearch, true, true).draw();
But it does not work. The message is "No entries found" in table, which means all rows are away.
can somebody help me with the correct syntax?
best regards
hans
Answers
Hi Hans,
Disable the built in smart search using the second parameter for
columns().search()
asfalse
. Having the smart search enabled will disrupt your own regex causing all sorts of issues!Allan
Hi Allen
thanks a lot,
Changing second parameter to false does not fix the problem.
Still "No entries available"
oTable.columns().search(regExSearch, false, true).draw();
But if I use this:
oTable.search(aData['unitynumber']).draw();
This will work
Hans
Can you link to the page showing the issue so it can be debugged please.
Allan
Sorry Allan, I do not know how I can do that because it is a Intranet application with dynamically data from a database. I can try to cut off all other code and put this to an fiddle, but therefore I need some time.
In the moment it will work fine with ;
oTable.search(aData['unitynumber']).draw();