This is a migrated thread and some comments may be shown as answers.

Performance problem when hiding a column client-side

1 Answer 37 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michal Chaniewski
Top achievements
Rank 2
Michal Chaniewski asked on 14 May 2012, 04:39 PM
I have an AJAX-bound MVC Grid that displays 200 rows of data per page across a set of columns.

By default only 7 columns are visible, but the user can select which columns should be included in the grid from the set of about 25. I don't use column menus, but rather my own UI and call grid.hideColumn() and grid.showColumn() directly.

I've encountered a serious performance problem: operation of hiding or showing a column takes several seconds, per each column that is shown or hidden. I was able to fix the issue for showing columns only, by setting display: nonefor the whole grid just before the loop that shows & hides the columns executes, and then showing the grid back after all changes are done. This cut the time of about 2-3 seconds per column to almost instant for the whole set. That would suggest the cause of problem lies in the amount of DOM manipulation happening behind the scenes.

Unfortunately the same solution is not possible when hiding columns. For some reason, when grid is hidden and shown again around the operation of hiding a column, the change has no effect (the column remains in the grid).

Any ideas how to fix that?
Thanks

1 Answer, 1 is accepted

Sort by
0
Big T
Top achievements
Rank 1
answered on 15 May 2012, 08:12 AM
Hi, I also have that same problem. I have 250 rows shown in client side mode and the script runs so long to hide a column the browser (Firefox) pops up a dialog asking if I want to cancel execution of the script.
Tags
Grid
Asked by
Michal Chaniewski
Top achievements
Rank 2
Answers by
Big T
Top achievements
Rank 1
Share this question
or