Ext.LoadMask 停留在加载面板的后台
我尝试在用户等待显示面板时显示加载蒙版。
我使用 Ext.LoadMask 像:
loadingMask = new Ext.LoadMask(Ext.getBody(), {msg:"Loading..."});
loadingMask.show();
panel = new MyPanel();
panel .show();
并在面板的渲染后
this.listeners = {
afterrender: function () {
loadingMask.hide();
}
}
但没有显示加载蒙版,直到面板出现,当我关闭面板时,我看到加载蒙版。
我认为这意味着我的加载蒙版正在后台运行,所以我看不到它。
您知道这个问题有解决方案吗?我认为这似乎是一个层问题。
如何使加载蒙版显示在顶部并在面板的渲染后隐藏它?
谢谢。
I try to show a loading mask while user waits for the panel to be shown.
I use Ext.LoadMask like :
loadingMask = new Ext.LoadMask(Ext.getBody(), {msg:"Loading..."});
loadingMask.show();
panel = new MyPanel();
panel .show();
and in panel's afterrender
this.listeners = {
afterrender: function () {
loadingMask.hide();
}
}
But no loading mask is shown till panel comes and when I close panel I see the loading Mask.
I think this means my loading mask is running in background so I can't see it.
Is there solution you know for this issue ? This seems like a layer problem I think.
How can I make loading mask be shown on top and in panel's afterrender hide it?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我想你正在寻找这样的东西:
我已经包含了 renderTo 配置选项来告诉 Ext 在页面上的哪里创建面板。除了示例中的几个拼写错误之外,我认为主要问题是您的渲染后处理程序没有触发,因为您没有将其附加到面板对象。您需要将其分配为配置选项的一部分。您将渲染后处理程序分配给“this”,它很可能是示例中的顶级窗口对象。
I think you're looking for something like this:
I've included the renderTo config option to tell Ext where to create the panel on the page. Apart from a couple of spelling mistake in your example, I think the main problem is that your afterrender handler is not firing because you are not attaching it to your panel object. You need to assign it as part of your config options. You are assigning your afterrender handler to 'this' which could quite possibly be the top level window object in your example.
这可能对您有用:
添加加载蒙版
删除加载蒙版
This might work for you:
Add loading mask
Remove loading mask
我把MyPanel的show函数放在delayedtask中。
然后我将 unmask 实现放在 MyPanel 的 beforedestroy 侦听器中。
我认为这个 LoadMask 应该有一些回调机制。
当我将节目放在一层之后,其他层就会变得混乱。
I put MyPanel's show function in delayedtask.
Then I put the unmask implementation in beforedestroy listener of MyPanel.
There should be some callback mechanism for this LoadMask thing i think.
When I put show following one and other layers get messed up.