简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM