adding items to the afnFiltering array (or something alike), but just for one table.
adding items to the afnFiltering array (or something alike), but just for one table.
Hi. I'm trying to get a custom row filter linked to a select for one table. The filter is somehow tricky and i went for a row filter via
[code]$.fn.dataTableExt.afnFiltering.push( ... )[/code]
The code was working fine, except that it is being applied by other unrelated tables. (opes!)
While preparing a testcase i did find one almost identical, related with a previous question.
http://live.datatables.net/oyinin/3/edit#javascript,html,live
So, that is the same that I'm doing, I'm pushing a filter function into the afnFiltering array.
The question is, Could i add the filtering function to the afnFiltering array for just one of the tables?
I can get away with it, somehow. For instance i can get the desired behavior just checking the id of the table http://live.datatables.net/oyinin/139/edit, but it feels sub-optimal :-)
...there sure is a better way to archieve this, that does not involve calling the filter at all for the other tables..
Thanks is advance.
[code]$.fn.dataTableExt.afnFiltering.push( ... )[/code]
The code was working fine, except that it is being applied by other unrelated tables. (opes!)
While preparing a testcase i did find one almost identical, related with a previous question.
http://live.datatables.net/oyinin/3/edit#javascript,html,live
So, that is the same that I'm doing, I'm pushing a filter function into the afnFiltering array.
The question is, Could i add the filtering function to the afnFiltering array for just one of the tables?
I can get away with it, somehow. For instance i can get the desired behavior just checking the id of the table http://live.datatables.net/oyinin/139/edit, but it feels sub-optimal :-)
...there sure is a better way to archieve this, that does not involve calling the filter at all for the other tables..
Thanks is advance.
This discussion has been closed.
Replies
http://datatables.net/development/roadmap
Regards,
Allan
i went with
[code]
$.fn.dataTableExt.afnFiltering.push (
function( oSettings, aData, iDataIndex ) {
if ( oSettings.sTableId !== 'table_i_want_to_filter' )
//do not apply to other tables.
return true;
//filter code goes here...
}
);
[/code]
Nethertheless, thanks a lot for the dataTables.
Greets
For instance, the afnFiltering "array of functions" nature is very well depicted in its name.
I guess some people might find it ugly, but it sure is useful.
just me saying!
Best Regards