Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82607

Individual column searching (select inputs)

$
0
0

I am trying the example: https://datatables.net/examples/api/multi_filter_select.html Individual column searching (select inputs)

on mine:

$(document).ready(function() { $('#example').DataTable( { initComplete: function () { "sScrollX": "100%", "sScrollXInner": "100%", "bScrollCollapse": true, "sPaginationType": "full_numbers", this.api().columns().every( function () { var column = this; var select = $('<select><option value=""></option></select>') .appendTo( $(column.footer()).empty() ) .on( 'change', function () { var val = $.fn.dataTable.util.escapeRegex( $(this).val() );

                    column
                        .search( val ? '^'+val+'$' : '', true, false )
                        .draw();
                } );

            column.data().unique().sort().each( function ( d, j ) {
                select.append( '<option value="'+d+'">'+d+'</option>' )
            } );
        } );
        $('#example tfoot tr').insertBefore($('#example thead tr'))
    }
} );

} ); }); });

but it is not working


Viewing all articles
Browse latest Browse all 82607

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>