angular-ui/ui-grid

How to Reduce the number of $watches created by ui-grid

Open

#4,554 opened on Oct 20, 2015

View on GitHub
 (9 comments) (1 reaction) (0 assignees)JavaScript (5,395 stars) (2,496 forks)batch import
help wantedseverity: performance

Description

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.

Contributor guide