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

iecwebmastiecwebmast Posts: 66Questions: 9Answers: 1

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

  • allanallan Posts: 61,662Questions: 1Answers: 10,094 Site admin

    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

  • iecwebmastiecwebmast Posts: 66Questions: 9Answers: 1

    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/

  • allanallan Posts: 61,662Questions: 1Answers: 10,094 Site admin
    Answer ✓

    Can you show me your updated code please? Making the change I suggested above appears to work identically: http://jsfiddle.net/3a2ntaoq/1/ .

    Allan

This discussion has been closed.