0
我有一个FormPanel中如下 -添加标签字段
var theForm = new Ext.form.FormPanel({
layout: 'tableForm',
border: false,
itemId: 'theForm',
layoutConfig: { columns: 5 },
defaults: { border: false, layout: 'form' },
items: [
{ xtype: 'label', text: 'Row 1' },
{ xtype: 'label', text: '' },
{ xtype: 'label', text: '' },
{ xtype: 'label', text: '' },
{ xtype: 'label', text: '' },
{ xtype: 'label', text: 'Row 2' },
{ xtype: 'label', text: '' },
{ xtype: 'label', text: '' },
{ xtype: 'label', text: '' },
{ xtype: 'label', text: '' },
//.... And so on
]
})
这种运作良好,并添加行的面板。加载时生成空标签文本。 正如你所看到的,可以有100个具有相同布局的行(col1除外),我不想重复这个项目布局100次。
有没有像通过使用循环或其他东西添加控件的东西。所以我不必重复这一点。 有什么办法可以添加这4列。
我试过使用theForm.add({ xtype: 'label', text: '' });
但它不起作用。
这是完美的。谢谢 –