Search code examples
datatablesyadcf

yadcf: search in multiples columns with initMultipleColumns does not work


I would like to implement a search field which works like the search field of Datatables, therefore it can search in several columns.

I want to be able to search for "Ramos" or "Software" and get results, but currently I can only search for "Ra" and get a result because this value is in both columns.

$(document).ready( function () {
  oTable = $('#example').DataTable();
  
  
  yadcf.initMultipleColumns(oTable, [{
        column_number: [0, 1], 
        filter_container_id: 's_suche', 
        filter_default_label: 'Search all',
        filter_match_mode : "contains"
        //filter_type: 'select'
    }]);
} );

Demo: http://live.datatables.net/dikuxuri/1/edit


Solution

  • initMultipleColumns: Allows to create filter that will affect multiple column(s) in in a particular table, it will look for a presence of your string in all relevant columns, if you search for "na" it will show you the rows in which the "na" appear in the relevant columns.

    If you wish a filter like the datatables, just use it, you can change its location with css