现在的位置: 首页 > 综合 > 正文

ext中fieldLabel文本太宽的问题

2013年05月30日 ⁄ 综合 ⁄ 共 1070字 ⁄ 字号 评论关闭

在layout: 'column',后的排列中,右对齐fieldLabel的宽度就不怎么好使。

经过几次调试,终于可以右对齐fieldLabel了,fieldLabel的右对齐比较麻烦,必须首先在form中设置labelWidth:40,同时在labelStyle中加上labelStyle : "text-align:right;width:40;",2个地方都要设置宽度才行,否则fieldLabel的宽度就不起作用。

                    {
                        columnWidth:.33,
                        layout:'form',
                        border:false,
                        labelWidth: 40,
                        items:[{
                        xtype:"combo",
                        fieldLabel: '地区',
                        name: 'combo',
                        labelStyle: 'text-align:right;width:40;',
                        store: new Ext.data.SimpleStore({
                            fields: ['value', 'text'],
                            data: [
                                ['value1', 'text1'],
                                ['value2', 'text2']
                            ]
                        }),
                        displayField: 'text',
                        valueField: 'value',
                        mode: 'local',
                        emptyText:'请选择'
                    }]
                    }

 

抱歉!评论已关闭.