最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to make textfield stick to its label in extjs? - Stack Overflow

programmeradmin0浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论