Multiple Column search not working.

Multiple Column search not working.

ashfaq-ahmedashfaq-ahmed Posts: 2Questions: 2Answers: 0
edited June 2016 in Free community support

Hello, i have tried many ways to search for multiple columns, like (column 1 = a AND column 2=b), i am trying to do multi-column search but it always search for single column, tried below methods none of them is working.

I am using server side data

Looped on each search field as below via looping column indexes

table.search("zaman").column(2).draw()

tried with hardcoding each field as a separate search

$("select[name='sdistrict']").on('change', function () {
        var SearchedVal = $(this).val();
        table.DataTable().columns(6).search(SearchedVal).draw();
        table.columns(6).search(SearchedVal).draw();
    } );

via hardcoding each field as below

table.search("zaman").column(2).draw()

this only works and get results but not for all fields it is showing result for the column i am typing on.

Please suggest.

(please note that i have fields separate then table, not in footer and not in header i have placed fields in a separate container, so i would like to search for those fields based on their ids and classes)

Thank you

This discussion has been closed.