Apply server side filters on click
Apply server side filters on click
tknight1984
Posts: 3Questions: 0Answers: 0
Hello,
I am using your excellent plugin and have managed to get most functionality required with ease. One requirement outstanding is the ability to only apply filters once an "Apply Filters" button is clicked. I have it working by iterating through each of my filters and calling fnFilter
[code] $("#btnApplyFilters").click(function () {
$("thead input[type=text]").each(function (i) {
alert("about to add")
oTable.fnFilter(this.value, $("thead input[type=text]").index(this));
alert("added")
});
oTable.fnDraw();
});
[/code]
Unfortunately, the call to fnFilter causes an ajax call to repopulate the grid. So if the user is trying to apply 3 filters, each call to fnFilter will cause a call to the server.
Is there anyway i can apply all the filters in one go on a button click?
Many thanks,
Tom
I am using your excellent plugin and have managed to get most functionality required with ease. One requirement outstanding is the ability to only apply filters once an "Apply Filters" button is clicked. I have it working by iterating through each of my filters and calling fnFilter
[code] $("#btnApplyFilters").click(function () {
$("thead input[type=text]").each(function (i) {
alert("about to add")
oTable.fnFilter(this.value, $("thead input[type=text]").index(this));
alert("added")
});
oTable.fnDraw();
});
[/code]
Unfortunately, the call to fnFilter causes an ajax call to repopulate the grid. So if the user is trying to apply 3 filters, each call to fnFilter will cause a call to the server.
Is there anyway i can apply all the filters in one go on a button click?
Many thanks,
Tom
This discussion has been closed.
Replies
I'm surprised that this hasn't come up before myself (or if it has, I've clean forgotten about it :-( ). But as I say, 1.10 will resolve this.
Allan
I am happy to suffer the additional server hit at the moment as it is very rare that someone will apply more than one filter.