ColVis - New Feature: multiple dropdown columns for long lists of table columns

ColVis - New Feature: multiple dropdown columns for long lists of table columns

stwistwi Posts: 10Questions: 0Answers: 0
edited February 2013 in Plug-ins
Hi,

I have extended the "ColVis" plugin with a new feature that I called "iMaxRows". It will ensure that the number of rows in the dropdown list created by the "ColVis" button will not exceed the maximum limit defined by "iMaxRows". This is particularely helpful when dealing with tables that have a large number of columns, as it prevents the dropdown list from becoming way too high to be nice and useful.

Since I was a bit at a loss how to provide you with the modified "ColVis.js" I decided to paste it into the "DataTables live" feature. You should be able to view my updated "ColVis.js" code and a working live demo here:
http://live.datatables.net/ipoduq/3/edit

(Click on "Render" to see the live demo, then modifiy the value of "iMaxRows" in the "Code" to see how it effects the live demo)

I'm keeping my fingers crossed that the above "DataTables live" thingy works out for everyone :-) Otherwise please inform me how else to provide the file.

Some notes on my coding:
* the "iMaxRows" option does NOT enfore the given number of rows, it just uses the value as a limit, the buttons for the columns will simply flow into the extra columns and quite often you end up with 1 row less than what "iMaxRows" specifies
* the "[STWI]" markers exist only to make searching for my changes easier, feel free to remove them

Regards,
Stephan
This discussion has been closed.