Get dropdown list value

Get dropdown list value

LArmstrong85LArmstrong85 Posts: 21Questions: 14Answers: 0

Hello,
one column of my table is a dropdownlist (select).
If I read a row with the instruction table.rows('.selected').data();
i read all row table field but not the select value.
How i can do it?

Answers

  • vinhtvu2vinhtvu2 Posts: 13Questions: 2Answers: 0

    Maybe create an event handler that does whatever task it is that you wanted it to do when something is selected in the selection list?

    table.columns().eq( 0 ).each( function ( colIdx ) {
            if( colIdx == "whichever column is the selection box")
            {
                $( 'select', table.column( colIdx  ).header() ).on( 'change', function () {
                    var search= this.value;
                    table.column( colIdx ).search( this.value );
                    table.draw();
                } );
            }
        } );
    
This discussion has been closed.