multiple filtering with submit button
multiple filtering with submit button
prorace
Posts: 1Questions: 0Answers: 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":
[code]
"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);
});
}
[/code]
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.
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":
[code]
"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);
});
}
[/code]
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.
This discussion has been closed.