更改项目图标后刷新 Sitecore
我将一个额外的事件处理程序连接到 Sitecore onItemSaved 操作,以更改 Sitecore 中项目的图标。图标发生更改,但您必须刷新 Sitecore 内容树才能看到它已更改。是否可以以编程方式确保更改后的图标在内容树中立即对用户可见?
我使用:
item.Field["__icon"].Value = "someicon.pgn"
周围有一个 Editing.BegintEdit()
和一个 EventDisabler
。
当您更改 Sitecore 本身中项目的图标时,图标会立即可见,这也是我希望看到的。
有什么建议吗?
谢谢!
I hooked up an extra eventhandler to the Sitecore onItemSaved actions to change the icon of an item in Sitecore. The icon gets changed, but you have to refresh the Sitecore content tree to see that it has changed. Is it possible to programatically make sure the changed icon gets visible to the user instantly in the content tree?
I used:
item.Field["__icon"].Value = "someicon.pgn"
with a Editing.BegintEdit()
and a EventDisabler
around it.
When you change the Icon of an item in Sitecore itself, the icon gets visible instantly, this is what I would like to see aswell.
Any suggestions?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要从代码中刷新内容树,请使用:
To refresh the content tree from the code use:
删除 EventDisabler,这可能是问题所在......
它还禁用客户端事件...
Remove the EventDisabler, that's likely the issue...
It also disables client events...