fnFilter callback?
fnFilter callback?
Hi,
I am wondering if there is any way to implement a callback once the fnFilter() has been completed? The data in my datatable was fetched from MySQL by php script using server side processing.
Basically I have implemented the "Show and hide details about a particular record" feature from the examples and I want the response row from fnFilter() to be "open", saves one click for the user.
Can I do this? I am still quite new to Javascript. Many thanks for any help.
@at299
I am wondering if there is any way to implement a callback once the fnFilter() has been completed? The data in my datatable was fetched from MySQL by php script using server side processing.
Basically I have implemented the "Show and hide details about a particular record" feature from the examples and I want the response row from fnFilter() to be "open", saves one click for the user.
Can I do this? I am still quite new to Javascript. Many thanks for any help.
@at299
This discussion has been closed.
Replies
Thank you very much.
@at299
[code]
oTable.fnFilter( 'whatever' );
doSomething();
[/code]
will do it.
The only exception to this is if you are using server-side processing - when the draw becomes asynchronous. In which case you can use fnDrawCallback and oSettings.bFiltered in the callback.
Allan
1. Based on the code above:
[code]
oTable.fnFilter( filter );
if ( filter === "whatever" ) {
doSomething();
}
[/code]
2. Or you could listen for the 'filter' event ( http://datatables.net/docs/DataTables/1.9.0/#filter ) and again do an 'if' condition checking for the filter value
3. Or you could bind an event listener to the filtering input looking for the value
Allan