multiple fnFilter question
multiple fnFilter question
Hello,
i have got a oTable with multiple fnFilter options for every column via API.
But for every fnFilter i have to send a new Request.
[code]
$('#example').dataTable().fnFilter(
$("#txt1").val(),
2,
true
);
$('#example').dataTable().fnFilter(
$("#txt2").val(),
3,
true
);
$('#example').dataTable().fnFilter(
$("#txt3").val(),
5,
true
);
[/code]
Can I combine these Requests to one Request?
i have got a oTable with multiple fnFilter options for every column via API.
But for every fnFilter i have to send a new Request.
[code]
$('#example').dataTable().fnFilter(
$("#txt1").val(),
2,
true
);
$('#example').dataTable().fnFilter(
$("#txt2").val(),
3,
true
);
$('#example').dataTable().fnFilter(
$("#txt3").val(),
5,
true
);
[/code]
Can I combine these Requests to one Request?
This discussion has been closed.
Replies
maybe you can change oSettings.aoPreSearchCols[ iColumn ].sSearch for all 3 columns before triggering the fnDraw()
[code]
$.fn.dataTableExt.oApi.fnResetAllFilters = function (oSettings, bDraw/*default true*/) {
for(iCol = 0; iCol < oSettings.aoPreSearchCols.length; iCol++) {
if (iCol == 1)
{
oSettings.aoPreSearchCols[ iCol ].sSearch = $("#yukHeight").val();
}
else if (iCol == 2)
{
oSettings.aoPreSearchCols[ iCol ].sSearch = $("#yukWeigth").val();
}
else
{
oSettings.aoPreSearchCols[ iCol ].sSearch = '';
}
}
//oSettings.oPreviousSearch.sSearch = '';
if(typeof bDraw === 'undefined') bDraw = true;
if(bDraw) this.fnDraw();
}
[/code]