Can I dynamically enable/disable the filter box?
Can I dynamically enable/disable the filter box?
Hello,
I'm just getting started with the tool and web dev in general, so please bear that in mind!
I have the dt working, including client-side filtering.
I need to be able to conditionally disable the table (or at least the filter feature) in response to a radio button on the page.
Before implementing the dt, I was disabling the fields in the table via assigned classed. Now I have this active filter box that feels goofy.
Is there a way to dynamically enable/disable it? Should I be trying to control the dt as a whole somehow, and not just the filter box?
Thanks!
I'm just getting started with the tool and web dev in general, so please bear that in mind!
I have the dt working, including client-side filtering.
I need to be able to conditionally disable the table (or at least the filter feature) in response to a radio button on the page.
Before implementing the dt, I was disabling the fields in the table via assigned classed. Now I have this active filter box that feels goofy.
Is there a way to dynamically enable/disable it? Should I be trying to control the dt as a whole somehow, and not just the filter box?
Thanks!
This discussion has been closed.
Replies
$('.dataTables_filter input').attr('disabled', true);
and to re-enable it:
$('.dataTables_filter input').removeAttr('disabled');