PDA

View Full Version : How to align form buttons on left



nik600
17 May 2010, 3:19 AM
Dear all

is it possible to align form buttons on left instead of right?

For example, in the example

http://www.extjs.com/deploy/dev/examples/window/hello.html



Ext.onReady(function(){
var win;
var button = Ext.get('show-btn');

button.on('click', function(){
// create the window on the first click and reuse on subsequent clicks
if(!win){
win = new Ext.Window({
applyTo:'hello-win',
layout:'fit',
width:500,
height:300,
closeAction:'hide',
plain: true,

items: new Ext.TabPanel({
applyTo: 'hello-tabs',
autoTabs:true,
activeTab:0,
deferredRender:false,
border:false
}),

buttons: [{
text:'Submit',
disabled:true
},{
text: 'Close',
handler: function(){
win.hide();
}
}]
});
}
win.show(this);
});
});


Buttons are aligned on right...how can i change it?
Is there a config option for that or i have to change manually the css?

Thanks to all

Condor
17 May 2010, 3:27 AM
buttonAlign:'left'

nik600
17 May 2010, 3:33 AM
Great!

can i set it as a default for all FormPanel Items? sould i extend the FormPanel class ?

Condor
17 May 2010, 3:55 AM
Your example is using a Window and not a FormPanel.

You could use:

Ext.Panel.prototype.buttonAlign = 'left';

nik600
17 May 2010, 4:02 AM
true, now is perfect!
Thanks