Is there a way to add/remove columns dynamically? What I’m attempting to get is, to have a dropdownlist of “Views” which has a pre-defined set of columns that needs to be shown to the user.
E.g., Default View, Admin View, HR View and Accounts View.
When user lands on page, Default View gets loaded and, I’d like the grid to show columns Col A, Col B, Col C, Col D, Col E, Col F
When user selects Admin View, I’d like the grid to show only Col A, Col B and Col C.
When user selects HR View, I’d like the grid to show only Col A, Col D and Col F.
….
…
etc
Currently this is what I’m doing
On Grid’s ready: function () {}, I’m hiding and showing columns. However, with this approach, I need to first get all columns and they appear to load and user sees all columns and then after a minute, grid refreshes and appropriate columns are shown.
I’d like to know if there is a way to dynamically add columns to the columns collection, without the need to explicitly declare them in the grid definition.
Thank you for your time on this.