tags:

views:

32

answers:

1

Hi all,

I'm looking for sample code on how to use config in EXTJS. Can anyone help?

Thanks!

A: 

You can use config objects to stereotype repetitive bits in your code.

var configObject = {
   xtype : 'label',
   width : 50,
   text  : 'some Text'
}
//create a panel 
new Ext.Panel({
    id: 'someID',
    items: [
    configObject,
    {
       xtype: 'textfield'
    },
    configObject,
    {
      xtype: 'radio'<br>
    }
    ]
})

Or:

new Ext.form.Label(configObject);
It Grunt