PDA

View Full Version : Rendering a button



youds
4 Jun 2014, 11:25 AM
Hi

See code
// Simple button, small, text only
Ext.createWidget('button', Ext.apply({
text : 'Small',
scale: 'small',
color: 'red'
}));

Why is this not generating a button???

Johnny Major
4 Jun 2014, 11:40 AM
Ext.createWidget has been depreciated since 4.0 instead you could use Ext.widget.

Below creates the button and you will notice I am not using Ext.apply. No need for Ext.apply


Ext.widget('button',{
text : 'Small',
scale : 'small',
color : 'red',
renderTo : Ext.getBody()
});

youds
4 Jun 2014, 11:41 AM
so i needed the renderTo config option