Dynamically disabling the default filtering of dataTable
Dynamically disabling the default filtering of dataTable
naddy19
Posts: 8Questions: 0Answers: 0
Hi,
I want to disable the default filtering of dataTable dynamically on a particular condition but i don't want to disable custom filtering. I had tried to change the 'sDom' string at run time, but it had no effect. I had also tried setting the 'bFilter' variable to false but doing this disables my custom filtering also.
What i need is somewhat like this
[code]
if (certain condition) {
disable the default dataTable filtering
}
//other code which needs to be executed with filtering disabled
if (certain condition) {
re-enable the filtering
}
// code which needs to be executed with filtering enabled
[/code]
Anyone please help me out with it.
Thanks
I want to disable the default filtering of dataTable dynamically on a particular condition but i don't want to disable custom filtering. I had tried to change the 'sDom' string at run time, but it had no effect. I had also tried setting the 'bFilter' variable to false but doing this disables my custom filtering also.
What i need is somewhat like this
[code]
if (certain condition) {
disable the default dataTable filtering
}
//other code which needs to be executed with filtering disabled
if (certain condition) {
re-enable the filtering
}
// code which needs to be executed with filtering enabled
[/code]
Anyone please help me out with it.
Thanks
This discussion has been closed.
Replies
[code]
function myCustomFilter(){
if (!certain condition) {
/* run default filter */
}
/* run custom filter */
}
[/code]
Actually the default filtering works before the custom filtering is applied.
The following is the code snippet from the dataTables plugin(lines 2029 - 2041) which filters the rows
[code]
/* Global filter */
_fnFilter( oSettings, oInput.sSearch, iForce, oInput.bRegex, oInput.bSmart, oInput.bCaseInsensitive );
fnSaveFilter( oInput );
/* Now do the individual column filter */
for ( var i=0 ; i
http://live.datatables.net/eyixob/edit#javascript,html,live
Thanks a lot for your suggestion, your solution meets my requirement. I will use this in my project.