1
我有一個可以正常工作的列表詳細視圖 - 它有一個tpl,沒有物品。我想添加其他組件,所以我添加了一個items數組,但現在tpl不再顯示。我已經嘗試保持tpl在主配置中,並將它作爲一個組件添加到無濟於事(數據如何知道適當的tpl位置btw?) - 我想理想情況下我想能夠注入我的列表數據在頁面的任何位置 - 我..上方和下方,以及項目之間。這是如何完成的?在Sencha Touch 2中混合tpl和物品
Ext.define("App.view.ListDetail", {
extend: "Ext.Container",
record: undefined,
config: {
layout: 'vbox',
style: "padding: 5px;",
scrollable: true,
// tpl: ["<div>", "name<br />verified star<br />avatar pic", "</div>"].join(""), // this works fine if I have no items array
//adding this causes above tpl to no longer render
items: [
{
xtype: 'component',
tpl: ["<div>", "name<br />verified star<br />avatar pic", "</div>"].join(""), //this does nothing
},
{
xtype: 'panel',
//more stuff here
},
]
}
});