Getting sorted filterd data while using deferRender

Getting sorted filterd data while using deferRender

temeteme Posts: 4Questions: 2Answers: 0
edited May 2014 in DataTables

Hello,

The only way if found I can get a sorted and filter list of rows is using the selector API. I am wondering if there is any other way I can get the filtered sorted raw data as I would like to use deferred rendering optimization. I am thinking as I am able to filter and sort even with deferred rendering there may be some way to get to the data outside the selector API which requires all rows be rendered. Basically what we are trying to do is be able to capture a sorted and filtered array of the row data before we move to a drill down page....

Thanks,
- Teme

Answers

  • temeteme Posts: 4Questions: 2Answers: 0

    I found the answer to my own question... dataTable.fnSettings().aiDisplay has the filtered indices to dataTable.fnSettings().aoData array in the current sort order. Iterating through that array and garbing the corresponding row from aoData will do the trick. I guess that was the way it was done before the selector API was introduced. Most recent reference I found suggest use of the selector API which works great as long as you are not using deferred render option...

  • andyvecandyvec Posts: 1Questions: 0Answers: 0

    I have the same problem when using deferRender.

    But when I try to use "dataTable.fnSettings().aoData" with the new API to get the data I get an error: "TypeError: datatable.fnSettings is not a function". Where datatable is my actual table.

  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin

    dataTable.fnSettings().aoData

    I would suggest never using the settings object. It is considered to be an internal property - it can, will and does change between versions.

    Do get the sorted filtered data from the table, you should be able to use the rows().data() method - table.rows( { filter: 'applied' } ).data() for example.

    Allan

This discussion has been closed.