您始终可以将加载蒙版应用于面板主体,因此工具栏处于活动状态并且可点击。
做这个操作非常简单。 您必须调用.setLoading()
面板,其中指定setLoading(load, target)
其中load是布尔值,目标是加载掩码的目标,该值应该是target = panel.body
之类的值。
根据我的答案我做了一点点捣鼓你:
https://fiddle.sencha.com/#fiddle/12h0
小提琴的代码是:
Ext.application({
name: 'Fiddle',
launch: function() {
Ext.create('Ext.panel.Panel', {
renderTo: Ext.getBody(),
border: true,
width: 200,
height: 200,
margin: 100,
id: 'myPanel',
defaults: {
margin: 10
},
layout: {
type: 'vbox',
pack: 'middle'
},
items: [{
xtype: 'textfield',
id: 'input'
}, {
xtype: 'panel',
html: 'Other things',
border: false
}],
dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
items: [{
text: 'Start Loading',
listeners: {
click: function(th) {
Ext.getCmp('input').setValue('opetation');
var panel = Ext.getCmp('myPanel');
if (!panel.loading) panel.loading = true;
else panel.loading = false;
panel.setLoading(panel.loading, panel.body);
th.setText(panel.loading ? 'Stop Loading' : 'Start Loading');
}
}
}]
}]
});
}
});
THX的答案,正是我是问。你能帮助我进一步提高吗?我在面板上使用'overflowY:'滚动',有时情节过大,因此_Loading ..._文本位于面板的可见部分。我如何在工具栏上显示_Loading ..._文字,并在工具栏上显示一些缩进符号? –
问题是如果您使用滚动条,加载面板不能完全覆盖面板? – Marco
不,加载掩码完全覆盖面板,但面板内容高度大于屏幕高度,并在屏幕底部边框下方的面板中间显示“Loading ...”文本。 –