Column filtering question: Don't add dropdowns to some columns using multi_filter_select

Column filtering question: Don't add dropdowns to some columns using multi_filter_select

ulrichulrich Posts: 2Questions: 0Answers: 0
edited March 2012 in General
Hello,

JQUERY and JavaScript newbie here, so this plug-in is just pure awesome :)

I'm using http://www.datatables.net/examples/api/multi_filter_select.html and I want to know if it's possible to not add the dropdown to some of the columns?

Like doing and then the code will not add a select menu on that specific column.

or using something like:

"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 8 ] } // better naming of course :)
],

Any help is appreciated.

Regards,

Ulrich

Replies

  • ulrichulrich Posts: 2Questions: 0Answers: 0
    edited March 2012
    Figured it out.

    [code]
    $("tfoot th#usedropdown").each( function ( i ) {
    this.innerHTML = fnCreateSelect( oTable.fnGetColumnData(i) );
    $('select', this).change( function () {
    oTable.fnFilter( $(this).val(), i );
    } );
    } );
    [/code]

    And the tag:

    [code]

    [/code]

    EDIT:
    Bleh.

    Not working as I thought it would. Data in dropdown menu is wrong.

    Like if I use this:

    [code]





    [/code]

    Dropdown menu 3 (under 4th column) shows data from 3rd column. This should be from fourth.
This discussion has been closed.