extjs:复选框缩进样式而不显示fieldlabel

时间:2011-05-04 09:48:20

标签: extjs checkbox indentation

关于复选框缩进样式的简短问题。将创建一个新的复选框,如下所示:

var newLegendItem = new Ext.form.Checkbox({
    boxLabel: "test",
    name: "test",
    checked:true 
 });

在浏览器中,输出复选框左侧没有缩进。我需要做什么来应用缩进的风格?

谢谢!

3 个答案:

答案 0 :(得分:2)

如果您想将其与其他表单字段内联对齐,请尝试:

hideLabel: false,
fieldLabel: ' '

答案 1 :(得分:1)

如果您希望它与其他表单元素对齐,根据文档,这是正确的方法:

hideEmptyLabel: false

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.form.Labelable-cfg-hideEmptyLabel

答案 2 :(得分:0)

设置边距,调整尺寸:

var newLegendItem = new Ext.form.Checkbox({
    style: 'margin-left: 30px',
    boxLabel: 'test',
    name: 'test',
    checked: true
});
相关问题