Filtering with hidden columns

Filtering with hidden columns

pukkpukk Posts: 3Questions: 0Answers: 0
edited December 2012 in General
I'm using DataTables in combination with the ColVis plugin to dynamically show/hide columns. All data gets fetched from server with an AJAX request.

I've also implemented individual column filtering. This works well, until I hide a column from display, in which case the column indexes get all screwed up.

I've searched for this on the forum and found out about the fnColumnIndexToVisible and fnVisibleToColumnIndex plug-ins, but I'm not sure which one of those I'm supposed to use, and how to implement it. Any help would be very much appreciated!

Replies

  • allanallan Posts: 63,531Questions: 1Answers: 10,474 Site admin
    You'd use visible to column index since you know the visible index and want to know the column index. You'd call it by simply passing in the visible index and it would return the column index which you then pass to fnFilter.

    Allan
This discussion has been closed.