从站点地图加载实体时执行 JScript
我有一个自定义实体,它在站点地图中有一个条目。当我在主窗口中加载实体时,它会打开右侧的网格视图 - 迄今为止的标准行为。
我现在想要更改网格体 DOM 中的一些内容。因此我应该在加载网格时执行 JavaScript。但我还没有找到任何方法来做到这一点。我这可能吗?
我的第二种方法是将网格放入 Iframe 中,然后在加载时执行任务。这可行,但我松开了实体上的所有按钮。
谢谢
I have a custom entity which has an entry in the sitemap. When I load the entity in the main window, it opens the grid view on the right - standard behaviour so far.
I now want to change some thins in the DOM of the grid body. Therefor I should execute a Javascript while loading the grid. But I have not found any way to do this yet. I sthis possible?
My second way was to but the grid into an Iframe and then do the task on load. This works, but I loose all the buttons from the entity.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能想到的最好的(可能也是唯一的)方法是附加 javascript 加载主页网格的方法是将您的功能添加到 (RibbonDiffXml)">
CustomRule
用于自定义主页网格功能区中任何对象的EnableRule
,它将在功能区加载时执行。唯一需要注意的是:在更改任何内容之前,您可能需要进行一些验证以确保网格处于正确的
readyState
状态,并且您需要确保返回true
如果您确实希望启用该功能区对象。The best (and probably only) way I can think of to attach javascript to the load of the homepage grid is to add your functionality to a
CustomRule
for anEnableRule
for any object in the custom homepage grid ribbon, which will execute at the time the ribbon loads.Only caveats: you probably will have to do some validation to make sure the grid is in the right
readyState
before changing anything, and you'll need to make sure to returntrue
if you actually want that ribbon object to be enabled.