Get table data when filter and column visibility are applied by user

Get table data when filter and column visibility are applied by user

cdonatecdonate Posts: 9Questions: 0Answers: 0
edited August 2013 in General
Hello guys.

I have a table that is very similar to this one: http://www.datatables.net/release-datatables/extras/ColReorder/col_filter.html

I use fnSetColumnVis for the column visibility.

The user can show and hide columns and filter each column individually.

I have to send to the server a JSON message of the visible columns and filtered items.

The filtered data is ok, I can get it, but I get everything, even the hidden columns. I can't seem to combine the two, filtering and column visibility.

I tried going through the DOM, but if I have more than 10 results and pagination is happening I can only get the first page (10 lines) since they are the only ones on the DOM.

Is there a way to solve this? Any help is appreciated.

Thanks!

Replies

  • allanallan Posts: 63,514Questions: 1Answers: 10,472 Site admin
    Try using the $ and _ API methods (nodes and data respectively):

    http://datatables.net/docs/DataTables/1.9.4/#$
    http://datatables.net/docs/DataTables/1.9.4/#_

    Allan
  • cdonatecdonate Posts: 9Questions: 0Answers: 0
    Thanks Allan, using $ worked very well.
This discussion has been closed.