w2grid.initColumnOnOff

Refreshes toolbar button that allows to show/hide columns.
initColumnOnOff()
Returns undefined.

Description

Every time you add or remove columns to the grid, the drop down menu on the toolbar that allows to show/hide columns should be rebuilt. This menu is built when grid is rendered, but not rebuilt when grid is refreshed. If you use .addColumn() or .removeColumn() it will rebuild toolbar show/hide column button. However, if you do change .columns array directly, you will need to call .initColumnOnOff() method in addition to .refresh() method.
If you have grid defined in the following way: And if you change columns directly, you will need to:

User Comments

comments powered by Disqus