家伙让我解释一下我的问题,我有一个加载一些元素从一个存储文件列表视图,当我点击列表项,我有谁在一个新的细节推数据的控制器查看煎茶触摸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