傢伙讓我解釋一下我的問題,我有一個加載一些元素從一個存儲文件列表視圖,當我點擊列表項,我有誰在一個新的細節推數據的控制器查看煎茶觸摸TPL和項目
'placesContainer places list':{
itemtap: function(list,index,target,record) {
console.log("item "+record.get('name')+" pigiato");
var detailsView = Ext.create('MyApp.view.Details');
this.getPlacesContainer().push(detailsView);
detailsView.setData(record.data);
}
}
確定這裏。現在我想要的是在我的新「詳細信息」視圖中從商店文件中加載相同的信息。 這裏是我的局部視圖:
Ext.define('MyApp.view.Details',{
extend:'Ext.Panel',
xtype:'details',
config:{
layout:'vbox',
scrollable:true,
styleHtmlContent:true,
styleHtmlCls:'details',
tpl:'<h1>{name}</h1>' +
'<p><span>Lunghezza:</span> {lunghezza} <span>Difficoltà:</span> {difficulty}</p>' +
'<h2>{prova}</h2>',
items: [
{
xtype: 'panel',
flex:1,
store:'Places',
},
{
xtype: 'carousel',
flex:2,
items: [
{style: "background-color: #7BB300"},
{style: "background-color: #555555"},
{style: "background-color: #00ff2a"},
{style: "background-color: #00bb1f"},
{style: "background-color: #008616"},
{style: "background-color: #00490c"}
]
}
]
}
如果我寫OUTSIDE項目TPL的元素,我可以讀出的數據在我的詳細信息視圖。當我嘗試把tpl元素內的項目,所有的數據消失..有什麼問題? 我試過這種方式,但沒有結果...
items: [
{
xtype: 'panel',
flex:1,
store:'Places',
tpl:'<h1>{name}</h1>' +
'<p><span>Lunghezza:</span> {lunghezza} <span>Difficoltà:</span> {difficulty}</p>' +
'<h2>{prova}</h2>',
},
items: [
{
xtype: 'panel',
flex:1,
store:'Places',
itemTpl:'<h1>{name}</h1>' +
'<p><span>Lunghezza:</span> {lunghezza} <span>Difficoltà:</span> {difficulty}</p>' +
'<h2>{prova}</h2>',
},
的幫助將是巨大的!
沒有試過,但是你可能需要實際調用'使用setData()'兩個孩子'Panel's的爲好。 – jprofitt 2013-03-22 12:12:00
在子面板中添加'setData()'是什麼意思? – 2013-03-22 12:21:36
你在'items'中有兩個'Panel's。用同樣的方法你打電話'使用setData()'的'detailsView',但對這些孩子,而不是在'detailsView'本身(或可能除了,這取決於你已經改變了它)。 – jprofitt 2013-03-22 12:41:08