PDA

View Full Version : how can i place a button in right side of panel ?



masoud_tamizy
28 Feb 2012, 4:41 AM
i want to place a button in right side of panel , but it place in left !!
how can i do it ?

tobiu
28 Feb 2012, 5:21 AM
depends on your layout! if you put your button into a toolbar, you can choose to display it left, centered or at the right side.

if you want to do it without toolbars, you can put a vbox layout into your panel, use an hbox layout in the second container, give the first container there a flex:1 value and the second one the width of your button. maybe a bit overnested, but it should do the trick.

Farish
28 Feb 2012, 5:22 AM
if you are using top bar (tbar) or bottom bar (bbar), you can use:


items:
[
'->',
{text: 'your_button'}
]

masoud_tamizy
28 Feb 2012, 6:40 AM
i want this :
32201
i use :


xtype: 'fieldcontainer',
anchor:'100%',
layout: {type:'hbox',align: 'center'},
items:[{text: '??? ? ?????? ????? ????',
xtype:'button',
id:'register_button',
name:'register',
formBind: true
]}

but it didn't work !!!

Farish
28 Feb 2012, 8:43 AM
one quick and dirty way to do it is by adding a space before the button:


{ xtype: 'tbspacer', width: 100 },
{ xtype: 'button',
// your button code here....
}

and then adjust the width so that the button moves left enough. this is not a good way to do it though.

tobiu
28 Feb 2012, 9:00 AM
do you read the replies you are getting? could save your time...

masoud_tamizy
28 Feb 2012, 10:38 AM
thank you tobiu & farish very much

vietits
28 Feb 2012, 6:37 PM
Have a try


xtype: 'fieldcontainer',
anchor:'100%',
layout: {type:'hbox', pack: 'end'},
items:[{
text: '??? ? ?????? ????? ????',
xtype:'button',
id:'register_button',
name:'register',
formBind: true
]}