Retrieving row data after filtering JQuery Datatables

后端 未结 8 426
广开言路
广开言路 2020-12-28 18:09

Seems like it should be easy but...

Does anyone know how to return the current rows from a filtered dataTable? The oTable.fnGetNodes() method returns

8条回答
  •  长发绾君心
    2020-12-28 18:37

    As of Datatables 1.10, there is a built-in way to get the filtered or unfiltered rows after a search.

    var table = $('#example').DataTable();
    table.rows( {search:'applied'} ).nodes();
    table.rows( {search:'removed'} ).nodes();
    

    There are other options for getting only the current page or all pages as well as the order. More details here: http://datatables.net/reference/type/selector-modifier

提交回复
热议问题