Reputation: 294
) 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]0: div#1445359168448-19-uiGrid-001Z-cell.ui-grid-cell.ng-scope.ui-grid-coluiGrid-001Zcontext: div#1445359168448-19-uiGrid-001Z-cell.ui-grid-cell.ng-scope.ui-grid-coluiGrid-001Zlength: 1__proto__: n[0]
watchers 4
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.
Upvotes: 6
Views: 1430
Reputation: 294
As a conclustion - using the row*col $$watchers is used as part of performance boost to use Scrolling virtualization. any way to dismiss this behivor didnt work.
we have decided to use another approachby using smart table its lightweight and we love its idea not to encapsulate/hide the Table/Grid layout creation but instead its aset of directives (plugins) allow you to compose you table behavior in a declarative way.
using declarative way = using angular ng-repeat and see the table template directly its much simple and less much easy to give to CSS dev to add the style.
still we cannot use it as a complex grid infrastructure need for a CRM solution - for this reason we still looking for solution - maybe Telerik UI Table
elad.
Upvotes: 0