将 loadMask() 应用于 extjs 中的单个元素?
如何将 loadMask 仅应用于一个元素,而不是整个浏览器宽度-高度?
default
这里,只有一个元素被屏蔽,消息框位于该元素内部的中心,而不是整个显示...
有什么想法吗?
编辑:
@Molecule,谢谢,但这是从某个源加载数据时,我需要的是:
{
xtype:"button",
text:"Alert",
handler: function(){
Ext.Msg.show({
title:'Save Changes?',
msg: 'You are closing ?',
buttons: Ext.Msg.YES,
setLoading: // here somehow only mask parent element, and position alertBox...
}
}
How to apply loadMask to only one element, and not the whole browser width-height?
default
here, only one element is masked, and a messageBox is in center, inside this element and not the whole display...
any ideas?
EDIT:
@Molecule , thanks, but this is when data is loading from some source, what i need is :
{
xtype:"button",
text:"Alert",
handler: function(){
Ext.Msg.show({
title:'Save Changes?',
msg: 'You are closing ?',
buttons: Ext.Msg.YES,
setLoading: // here somehow only mask parent element, and position alertBox...
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每个组件都有自己的
loadMask
属性。您可以通过调用YourComponent.setLoading
来使用它。这是 fiddle 来说明我在说什么。另一种方法是使用 new Ext.LoadMask(YourComponent.el, {msg:"Please wait..."});。您可以在我的 fiddle 中查看用法。
更新
这是代码示例,展示了如何将 ExtJS4 loadMask 和 MessageBox 应用于指定的小部件
,这里是 亲自尝试示例。
Every component has it's own
loadMask
property. You can use it by callingYourComponent.setLoading
. Here is fiddle to illustrate what I'm talking about.Another way is using
new Ext.LoadMask(YourComponent.el, {msg:"Please wait..."});
. You can look at usage in my fiddle.UPDATE
Here is code example which shows how to apply ExtJS4 loadMask and MessageBox to specified Widget
And here is try-it-yourself example.