我正在尝试使用商店中填充的数据将一堆组件添加到我的容器中。我想遍历我的商店记录并输出标签/面板/等来显示数据。
这就是我现在循环的方式:
  initComponent: function () {
  //Create a container for each array, then in that container, 
  //create a label and wrapping panel, then add the items to the wrapping panel
  this.store = Ext.create('Ext.data.Store', {
     model: 'MyProject.model.ItemArray',
     data: []
  });
  Ext.apply(this, {
     items: [
        this.store.each(function() {
           {
              xtype:'label', text:
              'test'
           }
        })
     ]
  });
  this.callParent(arguments);
}
但是,当然,作为我的 EXTJS 菜鸟,这是行不通的。我将不胜感激您可以提供任何建议和最佳实践技巧以使其正常工作。
我的模型 ItemArray 包含 Items。我需要遍历我的 ItemArrays 存储并制作容器,然后遍历 ItemArray 中的 Items,用 Items 填充这些容器。
感谢大家!