PDA

View Full Version : How to change configs of subcomponents created by Ext Designer



jaapdev
20 Apr 2012, 12:29 AM
I use Ext Designer to create my pages and I would like to set configs of subcomponents before rendering the components. The only option I know to do this is to promote an item to a class. But I don't want all items to be set as a class.

Example:
The following code is being generated by the Ext Designer.


Ext.define('DummyApp.view.ui.Deploy', {
extend: 'Ext.container.Viewport',
layout: {
type: 'fit'
},
initComponent: function() {
var me = this;
Ext.applyIf(me, {
items: [
{
xtype: 'panel',
title: 'My Panel',
items: [
{
xtype: 'button',
text: 'MyButton'
}
]
}
]
});
me.callParent(arguments);
}
});



And this one:



Ext.define('DummyApp.view.Deploy', {
extend: 'DummyApp.view.ui.Deploy',
initComponent: function() {
var me = this;
me.callParent(arguments);
}
});


How can I set e.g. the Button configs before rendering this component?

jsakalos
20 Apr 2012, 3:12 PM
Wrong forum? Shouldn't this belong to Ext Designer: Help & Discussion (http://www.sencha.com/forum/forumdisplay.php?49-Ext-Designer-Help-amp-Discussion) forum? I can move it there if you want.

aconran
20 Apr 2012, 10:16 PM
Promoting the subcomponent to a class is the only way to do this at the moment.

Sencha Architect may add the ability to prepareConfig's like so
http://www.sencha.com/forum/showthread.php?187267-Edit-designed-config&p=754690&viewfull=1#post754690

jaapdev
22 Apr 2012, 10:53 PM
Thanks for the reply. It would be great if this feature would be added!

Promoting to a class is a bit of an overkill for some situations.

jsakalos, changing this thread to a different forum is ok.