monkenWu / TablesIgniter

Tableslgniter is an addins base on CodeIgniter4. It will help you use jQuery Datatables in server side mode.
https://tablesigniter.monken.tw/
MIT License
14 stars 7 forks source link

how to implement column search #9

Closed elfaq closed 3 years ago

elfaq commented 3 years ago

i tried the method suggested by the datatables documentation, but failed, The following column filter script code that I use

// Setup - add a text input to each footer cell
$('.list_data thead tr:eq(1) th.kolomfilter').each( function () {
        var title = $(this).text();
        // $(this).html( '<input type="text" class="form-control" placeholder="'+title+'.." />' );
        $(this).html( '<input type="text" class="form-control form-control-sm" placeholder="...." />' );
} );
// Apply the search
table.columns('.kolomfilter').every( function () {
  var that = this;
        $( 'input', this.header()).on( 'keyup change clear', function () {
            if ( that.search() !== this.value ) {
                that
                    .search( this.value )
                    .draw();
            }
        } );
} );
monkenWu commented 3 years ago

Hi, TablesIgniter only supports server-based search. You can refer to the examples in the document to implement the ajax-based search function!