Datatables - Search Box outside datatable

前端 未结 11 1336
攒了一身酷
攒了一身酷 2020-11-30 17:08

I\'m using DataTables (datatables.net) and I would like my search box to be outside of the table (for example in my header div).

Is this possible ?

11条回答
  •  孤独总比滥情好
    2020-11-30 17:20

    As per @lvkz comment :

    if you are using datatable with uppercase d .DataTable() ( this will return a Datatable API object ) use this :

     oTable.search($(this).val()).draw() ;
    

    which is @netbrain answer.

    if you are using datatable with lowercase d .dataTable() ( this will return a jquery object ) use this :

     oTable.fnFilter($(this).val());
    

提交回复
热议问题