Getting filtered rows when using scroller plugin

Getting filtered rows when using scroller plugin

gqmulligangqmulligan Posts: 1Questions: 0Answers: 0
edited February 2013 in DataTables 1.9
Hi all,

I am trying to get the FULL filtered result set from data tables but am unable to find a good way to do this. I saw many other questions asking how to do something similar and the common answer was to use table._('tr', {"filter":"applied"}); however this will not work in my case because not all table rows have been created since I am using the scroller plugin.

The only way I could currently come up with was to bind to the filter callback on the table and use the aiDisplay array from the settings object so I can get the indexes of the filtered data.

Does anyone else know of a better solution?

Thanks for any suggestions.

Replies

  • vol7ronvol7ron Posts: 43Questions: 11Answers: 0
    edited March 2013
    I'm also trying to do something unique. I've got a checkbox for each row and need some way of accessing all rows, regardless if they're rendered.

    If there's a "select all" button in the header, it only applies to visible Scroller rows. The ideal would be to apply it to all filtered rows of the table (and to the whole table if there is no search filter), not just the rows that have been rendered.
  • vol7ronvol7ron Posts: 43Questions: 11Answers: 0
    I'm still figuring out the DataTables API and seeing how I can fork off the base library.

    This is looking promising: [code]oTable.fnSettings().asDataSearch[/code]

    I think we could be in business if we ammended asDataSearch to be an aaDataSearch ([[string,object],...]) or even create an aoDataSearch that resembles:
    [code]
    [ {'match':"what matched the search", 'object': $('tr of-searched-element') }
    , { ... }
    ]
    [/code]

    Perhaps Allan has some ideas.
  • vol7ronvol7ron Posts: 43Questions: 11Answers: 0
    I'll have to do some more testing. For some reason, I thought this wasn't returning all the necessary information with the Scroller plugin, but it goes in line with what gqmulligan stated:

    [code]aoData[ aiDisplay[rownum] ].nTr[/code] and if needed would replace the need for the amendment I was calling for above.
This discussion has been closed.