ColVis icon indicating copy to clipboard operation
ColVis copied to clipboard

Call stateChange before the other callbacks

Open jpobley opened this issue 10 years ago • 2 comments

Currently, the stateChange callback is the last function to be called after hiding/showing a column (colVis.js:640).

If stateChange callback is moved to a place before the other callbacks, then an application can know which column was hidden/shown before the table redraws. The main use case for this is when I'm tracking column visibility outside of the dataTables API and need to use it during one of the other callbacks, like createdRow or rowCallback. I add data-* attributes to DOM elements during the other callbacks based on which columns are visible.

jpobley avatar Jan 28 '15 20:01 jpobley

Probably best to have both callbacks - pre and post thinking about it.

ColVis is due for a rewrite, so I'll make sure to look into this when I get to that.

DataTables avatar Jan 28 '15 21:01 DataTables

Ok. I'm happy to put together a pull request for a pre callback if you don't think you'll get to the ColVis rewrite for a while.

jpobley avatar Jan 28 '15 21:01 jpobley