动态更新 Dojox ListItem
我一直在努力通过另一个窗格更新特定列表项的内容。
我能够成功更改列表项的内容。在执行 console.log()
时,变化很明显,但是,我无法让列表项在应用程序的 UI 中更新其内容。
var LI = dijit.byId("widgetID");
LI.params.tagToChange = "新值";
console.log(LI) // 可以确认该项确实已更改
但是,在 UI 中,列表项尚未更新。我似乎找不到有效的刷新或重新渲染功能。调用 buildRendering()
会引发错误。有谁知道强制刷新列表项的方法或动态更新列表项的内容并更新 UI 以反映更改的方法?
I have been working to update the contents of a particular list item via another pane.
I am able to successfully change the contents of the list item. The change is apparent when doing a console.log()
, however, I cannot get the list item to update its' contents in the UI of the app.
var LI = dijit.byId("widgetID");
LI.params.tagToChange = "a new value";
console.log(LI) // can confirm that the item has indeed been changed
However, in the UI, the list item has not been updated. I cannot seem to find a refresh or re-render function that works. Calling buildRendering()
throws an error. Does anyone know of a way to force refresh a list item or of some way to dynamically update the contents of a list item and have the UI update to reflect the change?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用
widget.set('attr', value)
而不是直接设置属性Try using
widget.set('attr', value)
instead of setting properties directly