ext中fieldLabel文本太宽的问题

    技术2025-02-14  12

    在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:'请选择'                    }]                    }

     

    最新回复(0)