PDA

View Full Version : Align form fields to right side



zombeerose
4 Nov 2009, 10:41 AM
Is it possible to get all form fields to align to the right side along with the buttons? I used the column layout to get them in a single row (before) but I'm at a lost for positioning them (after). I have exhausted my search and am under a deadline.

Any help is appreciated.

uniring
4 Nov 2009, 12:06 PM
I think what you need is to use anchors, the form layout is a subclass of the anchor layout, take a look at the anchor config option of the Ext.layout.AnchorLayout (http://www.extjs.com/deploy/dev/docs/?class=Ext.layout.AnchorLayout).

zombeerose
4 Nov 2009, 12:11 PM
I tried looking at the anchor layout but because I have not used it much, I am probably missing something.

Any examples with right aligned fields?

uniring
4 Nov 2009, 12:15 PM
You have an example (http://www.extjs.com/deploy/dev/examples/form/anchoring.html) at the samples page (http://www.extjs.com/deploy/dev/examples/samples.html).

Just play with the anchor values of your fields to get them anchored to the right.

Animal
4 Nov 2009, 12:19 PM
@OP, you don't explain anything. Is this in a Toolbar? Do you need labels with the fields? (would require a form layout)

zombeerose
4 Nov 2009, 12:21 PM
Sorry for the lack of detail.

* I do require form labels.
* I am just trying to create a form with fields in a single row that are aligned to the right side - no toolbars.

Animal
4 Nov 2009, 12:27 PM
Try a TableFormLayout (It's a UX) in a Container which you float to the right.

Animal
4 Nov 2009, 12:28 PM
Or a TableContainer http://www.extjs.com/forum/showthread.php?t=83252

Float it to the right, or position it absolutely right: 0