Search in a select ?

Search in a select ?

LudoztwLudoztw Posts: 3Questions: 2Answers: 0
edited July 2015 in Free community support

Hey everybody,

I use datatable in order to display a customize table.
My first two columns can be changed by users with a select. My fourth column is an input.
I have succeeded to order this columns like this :

$.fn.dataTable.ext.order['dom-select'] = function  ( settings, col )
{
        return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
            return $('select option:selected', td).text();
        } );
}

$.fn.dataTable.ext.order['dom-text'] = function  ( settings, col )
{
        return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
            return $('input', td).val();
        } );
}
$('#tableBody').dataTable({
        "aoColumns": [
            { "orderDataType": "dom-select"},
            { "orderDataType": "dom-select"},
            null,
            { "orderDataType": "dom-text", type: 'string' },
            null,
        ]
  });

Now, i don't know how the search function can searched in the select. It is working in the input but not in the select.

Do you have an idea? Thank you very much :)

(Sorry for my bad english)

Answers

This discussion has been closed.