Retrieving row data after filtering JQuery Datatables

后端 未结 8 427
广开言路
广开言路 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:36

    If you're trying to get the actual tr DOM elements instead of the data, the solution is similar to the underscore solutions provided above, but you use the $ method instead.

    function getFilteredDatatable() {
        return $("table.dataTable").dataTable().$('tr', { "filter": "applied" });
    }
    

    More information is available on the API documentation page. http://datatables.net/api

提交回复
热议问题