ストアに入力されたデータを使用して、コンテナに多数のコンポーネントを追加しようとしています。ストアのレコードを繰り返し処理し、ラベル/パネルなどを出力してデータを表示したいと思います。
これが私が今ループしている方法です:
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が含まれています。ItemArrayのストアをループしてコンテナーを作成してから、ItemArray内のItemをループして、それらのコンテナーにItemを追加する必要があります。
みんな、ありがとう!