Using radio buttons for filters

Using radio buttons for filters

versakversak Posts: 26Questions: 0Answers: 0
edited June 2011 in General
My datatable is filtering just fine, but the table has 2 columns where the data is checkboxes and I would like to be able to filter the individual columns by whether or not they are checked. I can manually enter into a text box "TRUE" or "FALSE" but I would like to use radio buttons to select the values plus a third for "ALL".

I've tried
[code]
$("thead input:radio").change(function(i){
oTable.fnFilter(this.value, $("thead input").index(this));
});
[/code]

I can make the radio buttons search globally, but I want it on a per-column basis. Can anyone offer any guidance?

Replies

  • versakversak Posts: 26Questions: 0Answers: 0
    I've figured out a good method for this. Instead of using radio buttons, I used 3 images for checked, unchecked and all. On each image I assigned an onclick to set the value of a hidden input to a value, then used $('#thelabel).trigger('keyup') to make the filter react.

    The issue I was having was that having other inputs (the radio buttons) within the header throws off the whole process and eliminating those made it work as expected.
This discussion has been closed.