-
Notifications
You must be signed in to change notification settings - Fork 2.5k
How to Reduce the number of $watches created by ui-grid #4554
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
Comments
Hi :-) from the documentation : http://ui-grid.info/docs/#/tutorial/316_dynamic_data_changes
Is there any way we can understand why this cell based $watches are created. we used the following code snippet to see and check the watch count
|
I've managed to reduce my grids to around 1000 watchers (I'm showing around 10 grids of around 50 rows each. It was mainly changing many bindings into one time bindings. I've found myself changing most of the templates, so this is my advice to you (I can't load the code here with the changes). |
But what did you change to the templates @YonatanKra ? I also have in place the row,cell and header template and as well defining a cellClass for the columns. I took the default templates within the source code. |
Hi @YonatanKra , |
Just switch to ag-grid guys, works like a charm and build with angular in mind. On Oct 13, 2016, at 21:12, Tim Lukacik <notifications@gh.loli.gardenmailto:notifications@github.com> wrote: @YonatanKrahttps://github.com/YonatanKra @Ruud-cbhttps://github.com/Ruud-cb @VioricaMihaihttps://github.com/VioricaMihai You can't do this unless your grid is so small there's no scrolling (and thus no virtualization) involved. ui-grid is reusing the same rows over and over again so if you are using 1 time binding it'll just display the same information as you scroll. I speak from experience! — |
@eladh @YonatanKra @csvan can you please suggest a workaround to get $watches count below 2000, its a serious concern for our application which has gone live with UI grid component. Browser gets hang when we try to use expand all feature with 50 as pagesize for parent and subgrid. |
I do know that some of the built in ui-grid templates have unnecessary watches on them that can be taken away if you do not use certain features. Within the template above i removed the ng-class as well as the role and ui-grid continued to work fine. |
Is there any update? |
Hello :-)
first i just wanted to say thanks for this great project.
we integrated ui-grid as part of our table-grid , and for some unknown reason the amount of watches generated by the ui-grid is huge for the amount of data we trying to process.
for example :
grid - 9 columns table with 20 rows of simple text based cells without any custom cell template
inspecting the $watches we getting amount of 960 watches.
trying to debug this issue we printed each element that has watch on him and most of the times we got this kind of elements :
[ div#1445359168448-19-uiGrid-001Z-cell.ui-grid-cell.ng-scope.ui-grid-coluiGrid-001Z,
context: div#1445359168448-19-uiGrid-001Z-cell.ui-grid-cell.ng-scope.ui-grid-coluiGrid-001Z]
and each cell element got 2-4 watches.
we used simple data structure with basic columnDefs (field + display name) .
in most of our cases we don't need to watch for chances in specific grid cells.
is there anything we can do to reduce the number of $watches created by ui-grid ?
thanks in advance,
elad.
The text was updated successfully, but these errors were encountered: