减少ui-grid创建的$ watch的数量

时间:2022-04-29 19:38:22

) 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.

我们将ui-grid集成为表格网格的一部分,由于某些未知原因,ui-grid生成的监视数量对于我们尝试处理的数据量来说是巨大的。

for example : grid - 9 columns table with 20 rows of simple text based cells without any custom cell template

例如:grid - 9列表,包含20行基于简单文本的单元格,没有任何自定义单元格模板

inspecting the $watches we getting amount of 960 watches.

检查$ watch我们获得960手表的数量。

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.

每个细胞元素有2-4个手表。

we used simple data structure with basic columnDefs (field + display name) .

我们使用简单的数据结构和基本的columnDefs(字段+显示名称)。

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 ?

我们有什么办法可以减少ui-grid创造的$ watch的数量?

thanks in advance, elad.

谢谢,提前。

1 个解决方案

#1


0  

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.

作为一个结论 - 使用行* col $$观察者作为性能提升的一部分用于使用滚动虚拟化。任何解雇这个behivor的方法都没有用。

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.

使用声明方式=使用角度ng-repeat并直接查看表格模板,它简单易用,并且不太容易给CSS dev添加样式。

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

我们仍然无法将其用作CRM解决方案的复杂网格基础架构需求 - 因此我们仍在寻找解决方案 - 也许是Telerik UI Table

elad.

#1


0  

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.

作为一个结论 - 使用行* col $$观察者作为性能提升的一部分用于使用滚动虚拟化。任何解雇这个behivor的方法都没有用。

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.

使用声明方式=使用角度ng-repeat并直接查看表格模板,它简单易用,并且不太容易给CSS dev添加样式。

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

我们仍然无法将其用作CRM解决方案的复杂网格基础架构需求 - 因此我们仍在寻找解决方案 - 也许是Telerik UI Table

elad.