Custom filtering help?

Custom filtering help?

NekkonNekkon Posts: 4Questions: 3Answers: 0
edited July 2014 in DataTables 1.10

Need some help with custom filtering. I am kinda stuck and don't understand what I am doing wrong..

$.fn.dataTable.ext.search.push(function (settings, data, dataIndex) {
    var value1 = ('#Select1').val();
    var value2 = ('#Select2').val();
    var value3 = ('#Select3').val();
    var value4 = ('#Select4').val();
    var value5 = ('#Select5').val();

    if ((data[5].equals(value1) || (value1 == '')) && (data[2].equals(value2) || (value2 == '')) && (data[3].equals(value3) || (value3 == '')) && (data[4].equals(value4) || (value4 == '')) && (data[9].equals(value5) || (value5 == ''))) {
        return true;
    }
    return false;
});

I am trying to compare the value of each select of my page that is a filter, with the corresponding value data[x]. But, it does not work for a reason..

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Not sure why that wouldn't work. Can you link to a test case showing the issue please.

    Allan

This discussion has been closed.