Can I dynamically enable/disable the filter box?

Can I dynamically enable/disable the filter box?

tbeaulieutbeaulieu Posts: 5Questions: 0Answers: 0
edited March 2011 in General
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!

Replies

  • tbeaulieutbeaulieu Posts: 5Questions: 0Answers: 0
    I found the solution to this.

    $('.dataTables_filter input').attr('disabled', true);

    and to re-enable it:

    $('.dataTables_filter input').removeAttr('disabled');
This discussion has been closed.