PDA

View Full Version : When to use config: ? (layout not working)



Maxeta
6 Nov 2013, 7:21 AM
I have seen config: used here and there, and decided to start using it to see what it actually does. I thought it was just to separate new properties and existing properties within a Ext.define, however certain things seem to get messed up when I use it like that. Here is an example:



Ext.define('appName.view.vViewport', {
extend: 'Ext.container.Viewport',

config: {
layout: 'border',
items: [
{
region: 'center',
xtype: 'panel'
},
{
region: 'south',
xtype: 'panel'
}
]
},


initComponent: function () {
var me = this;
me.callParent();
clog('vViewport.initComponent()');
}


});


with layout inside the config, it appears to use auto (not border), with layout outside the config it works as expected. Can someone give me a brief explanation of config: or at least point me to detailed documentation on it's use. Thanks.

ettavolt
6 Nov 2013, 11:10 AM
It is most used in Touch, not ExtJS.
However, for my opinion, it is rather limited, because it doesn't allow to override not "configurable" properties and/or methods.