我有一个表格如下 -
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: '' });
但它不起作用。