I'm trying to use the dataTables fnMultiFilter plug in. I was previously using it with no problem.
However, I've "upgraded" the site I'm using it on a big and doing some ajax rendering if pages, which I believe might be the problem.
On page load I include datatables and some extras as well as a couple of js file includes handling my datatable calls and the plugin code:
I have a menu system that, when clicked, renders a page, via ajax, containing the table. At that point I instantiate the datatable when that document renders.
In that page is also a form I built that - on click - calls $("#mytableid").dataTable().fnMultiFilter()...... but I always get a $(...).dataTable(...).fnMultiFilter is not a function.
This would be an example of what I'm using to call it:
I'm guessing this has something to do with the fact that the datatable is being rendered inside an ajax rendered page.
Has anybody else attempted this, and if so, how did you make it work. For the datatable itself, the standard search box and the sorts all work just fine... It is just that it seems that I'm not able to "find" the rendered datatable with the multifilter call...
Thanks, in advance. Anybody who would like to see what I'm getting at can ask and I'll give them a temporary user/pass to see what I'm doing.
However, I've "upgraded" the site I'm using it on a big and doing some ajax rendering if pages, which I believe might be the problem.
On page load I include datatables and some extras as well as a couple of js file includes handling my datatable calls and the plugin code:
$.fn.dataTableExt.oApi.fnMultiFilter = function( oSettings, oData ) { for ( var key in oData ) { if ( oData.hasOwnProperty(key) ) { for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ ) { if( oSettings.aoColumns[i].sName == key ) { /* Add single column filter */ oSettings.aoPreSearchCols[ i ].sSearch = oData[key]; break; } } } } this.oApi._fnDraw( oSettings ); };
I have a menu system that, when clicked, renders a page, via ajax, containing the table. At that point I instantiate the datatable when that document renders.
In that page is also a form I built that - on click - calls $("#mytableid").dataTable().fnMultiFilter()...... but I always get a $(...).dataTable(...).fnMultiFilter is not a function.
This would be an example of what I'm using to call it:
$("#cschedtable").dataTable().fnMultiFilter( {"course":jQuery("#course").val(), "location":jQuery("#searchLocation").val(),"booked":jQuery("#booked").val(),"final":jQuery("#final").val(),"archive":jQuery("#archive").val(),"class_start_date":jQuery("#class_start_date").val(),"class_end_date":jQuery("#class_end_date").val()} );
I'm guessing this has something to do with the fact that the datatable is being rendered inside an ajax rendered page.
Has anybody else attempted this, and if so, how did you make it work. For the datatable itself, the standard search box and the sorts all work just fine... It is just that it seems that I'm not able to "find" the rendered datatable with the multifilter call...
Thanks, in advance. Anybody who would like to see what I'm getting at can ask and I'll give them a temporary user/pass to see what I'm doing.