我有一个可折叠面板:
$cls.superclass.constructor.call(this, Ext.apply({
panel = new Ext.Panel({
title: "Panel",
collapsed: true,
items: [
this.section({
items: [
this.filter = new Ext.form.DisplayField({})
]
})
],
collapsible: true,
})
});
Ext.extend($cls, frame.mono.dialog.ObjectPanel, {
afterRender: function(rule) {
$cls.superclass.afterRender.apply(this, arguments);
//depending on some condition I'm trying to change the value of collapsed to false
//if (//some condition) {
this.panel.collapsed = false;
this.panel.doLayout(); // this is not working
}
}
});
如何根据条件在可折叠面板中设置折叠值?
你可以使用toggleCollapse方法来实现你想要做的事情。在prerender活动中进行。
请参考以下小提琴 -