Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set visibility of multiple columns at once #632

Closed
Azkel opened this issue Feb 13, 2017 · 2 comments
Closed

Set visibility of multiple columns at once #632

Azkel opened this issue Feb 13, 2017 · 2 comments
Labels

Comments

@Azkel
Copy link

Azkel commented Feb 13, 2017

Hi,

I'm trying to hide/show multiple columns at once, but after every column visibility change, grids gets rendered, which makes performance an issue for me.

Is there some way to update multiple columns at once, or stop grid from rerendering until the end of setting visibility for all columns?

@Azkel
Copy link
Author

Azkel commented Feb 13, 2017

Figured it out by myself - note for people having this same kind of issue in a future.

Each call to fieldOption calls a method to once again render a grid, so the easiest way was to change each field as wanted by getting it by jsGrid.fields, and after setting each column as wanted calling $('#jsGrid').jsGrid("render"). Thanks to that grid is rendered only once, but with all desired columns visible.

@Azkel Azkel closed this as completed Feb 13, 2017
@tabalinas
Copy link
Owner

Glad that you figured it out!
Thanks for sharing the solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants