通过UI网格cellTemplate正确渲染渲染指令

编程入门 行业动态 更新时间:2024-10-21 19:54:46
本文介绍了通过UI网格cellTemplate正确渲染渲染指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我遇到一个奇怪的问题,我的指令似乎是陈旧row.entities执行,这意味着当你向下滚动或修改排序网格它没有得到新的值。最初〜20行渲染罚款,但过去该指令成为解除关联的行。

I am experiencing a strange issue in that my directive seems to be executing on stale row.entities, meaning it does not get the new values as you scroll down or modify the sort of the grid. The initial ~20 rows render fine but past that the directives become disassociated with the rows.

请参阅我很一起砍死例如 rel=\"nofollow\">。

See my very hacked together example here.

推荐答案

它看起来像在EX pression传递给指令改变排序值,但前pression本身保持不变。

It looks like during sort values of the expression you pass to directive change, but the expression itself stays the same.

您应该更改范围&安培; 前pression结合 = 值绑定(并访问值与 scope.installs ,没有函数调用),那么你就可以跟踪更改。

You should change scope & expression binding to = value binding (and access the value with scope.installs, without function call), then you will be able to track the changes.

// ... scope: { installs: '=' }, // ...

然后,跟踪你可以使用范围发生变化。$看,把你的code内。

link: function (scope, element, attrs) { scope.$watch('installs', function(newValue) { // your code, you can use newValue as current installs value var installs = newValue; // ... }); }

这里。

更多推荐

通过UI网格cellTemplate正确渲染渲染指令

本文发布于:2023-11-23 04:49:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1620154.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:网格   指令   正确   UI   cellTemplate

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!