admin管理员组

文章数量:1023083

hi i have a big windows with a form in it and some text fields.by default labels are aligned to the left and their input boxes are aligned to center. Is there a way to stick input boxes to their labels in left? Is there any tutorial on how to work with css on extjs?

hi i have a big windows with a form in it and some text fields.by default labels are aligned to the left and their input boxes are aligned to center. Is there a way to stick input boxes to their labels in left? Is there any tutorial on how to work with css on extjs?

Share Improve this question asked Feb 26, 2011 at 3:32 Mehdi FanaiMehdi Fanai 4,06913 gold badges53 silver badges76 bronze badges 1
  • There are many ways to affect the placement of fields and their labels, but it would be much easier to help if you included your form code in the question. – Tommi Commented Feb 26, 2011 at 6:28
Add a ment  | 

2 Answers 2

Reset to default 5

Use:

labelAlign : 'right'
in your form config. for example:

var form = new Ext.form.FormPanel({
    height : 200,
    width  : 250,
    labelAlign : 'right'
    labelWidth : 80, //because my fieldlabel is short enough
    items      : [{
        fieldLabel : 'Name',
        ....
    }, ....]
})

Concerning your question on CSS: You won't be able to reposition Components contained in a Container with a FormLayout, unless you use !important all over the place.

This is because the layout sets the child ponents' dom style properties at render time.

hi i have a big windows with a form in it and some text fields.by default labels are aligned to the left and their input boxes are aligned to center. Is there a way to stick input boxes to their labels in left? Is there any tutorial on how to work with css on extjs?

hi i have a big windows with a form in it and some text fields.by default labels are aligned to the left and their input boxes are aligned to center. Is there a way to stick input boxes to their labels in left? Is there any tutorial on how to work with css on extjs?

Share Improve this question asked Feb 26, 2011 at 3:32 Mehdi FanaiMehdi Fanai 4,06913 gold badges53 silver badges76 bronze badges 1
  • There are many ways to affect the placement of fields and their labels, but it would be much easier to help if you included your form code in the question. – Tommi Commented Feb 26, 2011 at 6:28
Add a ment  | 

2 Answers 2

Reset to default 5

Use:

labelAlign : 'right'
in your form config. for example:

var form = new Ext.form.FormPanel({
    height : 200,
    width  : 250,
    labelAlign : 'right'
    labelWidth : 80, //because my fieldlabel is short enough
    items      : [{
        fieldLabel : 'Name',
        ....
    }, ....]
})

Concerning your question on CSS: You won't be able to reposition Components contained in a Container with a FormLayout, unless you use !important all over the place.

This is because the layout sets the child ponents' dom style properties at render time.

本文标签: javascriptHow to make textfield stick to its label in extjsStack Overflow