Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

multiple filtering with submit button

$
0
0
Hello,

I'm new with datatable. I've already checked a lot of post but not found what I need. I currently have multiple text boxes and one datatable.
I need to send to server side the values which are in my textboxes to filter the results. Currently I'm using the "aoData.push":


"fnServerData": function (sSource, aoData, fnCallback) {
            /* Add some extra data to the sender */
            aoData.push({ "name": "CompanyName", "value": $('#myCustomTSearchextFieldCompanyName').val() }, { "name": "Address", "value": $('#myCustomTSearchextFieldAddress').val() });
            $.getJSON(sSource, aoData, function (json) {

                /* Do whatever additional processing you want on the callback, then tell DataTables */
                fnCallback(json);
            });
        }


As "$('#myCustomTSearchextFieldCompanyName').val()" is used to filter the first column and "$('#myCustomTSearchextFieldAddress').val()" the second column, I think it's better to send the parameters via sSearch_0 and sSearch_1.

But I've no idea how can I set the "sSearch_x" on the submit click.

I've also already checked the "columnFilter" add-in but as I've a specific html for the responsive design I don't want to change my code again.

Thank you.

Viewing all articles
Browse latest Browse all 1816

Trending Articles