How to update my $.fn.dataTableExt.afnFiltering.push to comply with Datatables 1.10
How to update my $.fn.dataTableExt.afnFiltering.push to comply with Datatables 1.10
I have a custom fiter which uses $.fn.dataTableExt.afnFiltering.push, which I need to upgrade to comply with Datatables 1.10.
Here is the legacy code:
$.fn.dataTableExt.afnFiltering.push(function (oSettings, aData, iDataIndex) {
var filter = $('input[name=RadioGroup1]:checked').data('meet'),
meet = aData[4];
return meet == filter || filter == "*";
});
Here is what I have tried to use, following the new naming conventions:
$.fn.dataTableExt.afnFiltering.push(function (settings, searchData, index, rowData, counter) {
var filter = $('input[name=RadioGroup1]:checked').data('meet'),
meet = data[4];
return meet == filter || filter == "*";
});
What is it that I need to change to make this function work now? Thank you in advance for your help!!!
This question has an accepted answers - jump to answer
Answers
What you have should work just fine. Does it not? If not, can you l ink to the page showing the issue please.
$.fn.dataTable.ext.search
is the preferred name of the search array in 1.10, but it is exactly the same array as$.fn.dataTableExt.afnFiltering
so it doesn't matter which name you use.Allan
I'm having a conflict with other functions. I've made a jsfiddle of a model which works with the previous version. When I try to upgrade to the new code it no longer works.
http://jsfiddle.net/lbriquet/3a2ntaoq/
Can you show me your updated code please? Making the change I suggested above appears to work identically: http://jsfiddle.net/3a2ntaoq/1/ .
Allan