2 DataTables on a website - how to use a range-filter on the 1st only????
2 DataTables on a website - how to use a range-filter on the 1st only????
Hello everyone,
not sure if this is a "general" thing, but...
I got 2 Tables ( id's are "a" and "b", different amount of columns - 8 and 5), and I got 2 textfields to filter a date range. I want to filter the 8th column of table "a".
I am using $.fn.dataTableExt.afnFiltering.push(), but it's trying to do the range on the 2nd table ("b"). When I remove the 2nd Table, it works! How can I tell the push()-Function to use the 1st table ("a") but still keeping the 2nd table on the website?
Thanks in advance.
Douglas
not sure if this is a "general" thing, but...
I got 2 Tables ( id's are "a" and "b", different amount of columns - 8 and 5), and I got 2 textfields to filter a date range. I want to filter the 8th column of table "a".
I am using $.fn.dataTableExt.afnFiltering.push(), but it's trying to do the range on the 2nd table ("b"). When I remove the 2nd Table, it works! How can I tell the push()-Function to use the 1st table ("a") but still keeping the 2nd table on the website?
Thanks in advance.
Douglas
This discussion has been closed.
Replies
This is an unfortunate side effect of how the filtering plug-ins are applied to DataTables. The way around it is to check to see if the oSettings variable (first parameter in the function) matches the settings variable for the first table or not. If it does, then perform the filtering - if not, then return true (i.e. no filter).
It's not a particularly elegant way of doing this I'll be the first to admit - I really hope in future to find a better way of doing it (when I get a chance to re-architecture DataTables...).
Regards,
Allan
thank you for the hint.
I solved it by adding following line somewhere in the push() function:
[code]if ( oSettings.sInstance == 'a' ) { ... } [/code]