[英]How to hide panel in Extjs?
Good day. 美好的一天。
I have code: 我有代码:
{
xtype: 'panel',
title: 'test panel',
html:'test,
visible: false// did not work
}
How to prevent show panel without listeners and controllers? 如何防止没有监听器和控制器的显示面板?
The hidden
config usually is not applied to a part's view, only Sencha knows why. hidden
配置通常不会应用于部件的视图,只有Sencha知道原因。
However, if you want, you can do so with a single line of code in the part's createView
method. 但是,如果需要,可以使用部件的
createView
方法中的单行代码执行此操作。 To take your fiddle example: 拿小提琴的例子:
Ext.define('GAINS.parts.ConfigPart', {
extend: 'Ext.dashboard.Part',
alias: 'part.config-part',
config: {
hidden: false,
viewTemplate: {
layout: 'fit',
mergin: 9
}
},
createView: function (config) {
var view = this.callParent(arguments);
view.items = config.configPartItems;
if(config.hidden) view.hidden = true; // apply the "hidden" config to the view.
return view;
}
});
Use the property hidden
instead: 使用
hidden
的属性:
{
xtype: 'panel',
title: 'test panel',
html:'test,
hidden: true // <<== Should works
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.