PDA

View Full Version : [FIXED] Collapsible Promoted Classes



Artistan
20 Jul 2010, 6:18 AM
I have an xtype that is collapsible.
This is included in a north region of a border panel, also have one in a south region.

this.items = [
{
xtype: 'foo;
},
{
region: 'north',
minHeight: 250,
height: 250,
split: true,
xtype: 'ben_form_csearch'
}
];

ben_form_csearch is set to collapsible but when I collapse I end up with collapse but not fully expand.
similar to this... ExtJS post "ext.extend(ext.panel)... does strange things..." (http://www.sencha.com/forum/showthread.php?102946-ext.extend%28ext.panel%29...-does-strange-things...&highlight=collapsible+button+expand)

One Solution:
Add the "collapsible" config to the parent.
If I add "collapsible:true," to the border panel item, then it works as expected!


this.items = [
{
xtype: 'foo;
},
{
region: 'north',
minHeight: 250,
height: 250,
split: true,
xtype: 'ben_form_csearch',
collapsible: true
}
];

jarrednicholls
20 Jul 2010, 12:33 PM
Hi Artisan,

I am not totally familiar with this issue, but I believe it has something to do with initialConfig and the fact that an extended class' prototype is not set to initialConfig, but initialConfig is where layouts pull configuration information.

Layout configurations really should be put on the "instance" of a component, when it is being used, not on the prototype of the component itself. If you think about it from an Object Oriented or Component Oriented approach, your component is not as reusable when you default layout specific configurations on it...so it's better practice to keep your components as reusable as possible.

In short, with your current scenario, I recommend putting collapsible on the "Linked Instance" of the promoted class, where it is being "used"...not on the promoted (root level) class itself.

Artistan
22 Jul 2010, 5:27 AM
As I stated to begin with...
"Add the "collapsible" config to the parent."

Which is the same as...
"I recommend putting collapsible on the "Linked Instance" of the promoted class"

This is currently NOT an option.
That is what I was trying to say as a recommendation for fix, adding that option to the Instance of the class.

If it cannot be an option added to the instance in designer, is there a way to do it without updating the parent .ui class? I have not found one.

Thanks!

jarrednicholls
22 Jul 2010, 6:16 AM
Understood completely...I thought the collapsible config was an option for the border layout already. I've added it and it will be included in the next release. This change will allow you to set collapsible on the linked instance.

Artistan
22 Jul 2010, 6:20 AM
Sweet, that is all excellent.
Thank you for taking another look!