ColumnFilter plugin with Radio Buttons

ColumnFilter plugin with Radio Buttons

pricejtpricejt Posts: 12Questions: 5Answers: 1
edited December 2012 in Plug-ins
In my gridview a row will have a couple of different radio buttons in one column. I use this like a status. For example i have a gridview with a test case and one of the columns is called status. In this column for each row you might have statues (New, Review, Complete, Error). A user can pick a different status for each row. This all works great however now i want to filter these down. Lets say i want to see all the rows with the status New selected.

I am currently using ColumnFilter plugin for the rest of my columns and was hoping to use this plugin for this need as well. I started by creating a drop down list of the statuses.

[code]
{
type: "select", values: [ 'New', 'Review', 'Complete', 'Error'] //Status Column
},
[/code]

This shows up great however like I expected it won't filter down to only the ones selected.
Any ideas?

Replies

  • pricejtpricejt Posts: 12Questions: 5Answers: 1
    I started writing a custom filter and I think i am headed in the correct direction just need a little bit of help.

    This is my function:
    [code]
    $.fn.dataTableExt.afnFiltering.push(
    function(oSettings, aData, iDataIndex) {
    var status = $('.select_filter').val();
    alert("status value" + aData[5]);
    var statusValue = aData[5];
    alert(status);
    }
    );
    [/code]

    The first alert returns me the data generated from that column. However i need to parse it down to the value of the hidden input box, which would = "complete". Is there any easy way to do this or do i just need to substring it out?

    Thanks

    [code]New
    Review
    Complete
    Error


    [/code]
This discussion has been closed.