Two filtering methods on multi column

Two filtering methods on multi column

muzammilrmuzammilr Posts: 4Questions: 2Answers: 0

I am trying to integrate arithmetic + default filtering on multiple columns. I was able to get the arithmetic based filtering for all the numeric columns but getting the default along with it proving to be very tricky.

You can use < operator for age, but i need to provide a string based search as well.

PS: I am very new to java-scripting and the example my have some dumb options

This is my example http://jsfiddle.net/n35hr/16/

Answers

  • muzammilrmuzammilr Posts: 4Questions: 2Answers: 0

    got it working by adding this

        $("#example tfoot input").on( 'keyup change', function () {
            table.draw();
            index = $(this).parent().index();
            filter = this.value.replace(/\s*/g, '');
            opt = filter.match(/^(<|>)?(\w*|\d*)?/)[1];
            num = filter.match(/^(<|>)?(\w*|\d*)?/)[2];
                    if(typeof opt === "undefined")
                    {
                        console.log("opt");
                    table
                        .column($(this).parent().index() + ':visible')
                        .search(this.value)
                        .draw();
                    }
    
        });
    
This discussion has been closed.