Datatables - Search Box outside datatable

前端 未结 11 1341
攒了一身酷
攒了一身酷 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:47

    If you are using JQuery dataTable so you need to just add "bFilter":true. This will display default search box outside table and its works dynamically..as per expected

    $("#archivedAssignments").dataTable({
                    "sPaginationType": "full_numbers",
                    "bFilter":true,
                    "sPageFirst": false,
                    "sPageLast": false,
                    "oLanguage": {
                    "oPaginate": {
                        "sPrevious": "<< previous",
                        "sNext" : "Next >>",
                        "sFirst": "<<",
                        "sLast": ">>"
                        }
                    },
                "bJQueryUI": false,
                "bLengthChange": false,
                "bInfo":false,
                "bSortable":true
            });    
    

提交回复
热议问题