2
我瞭解,通過調用MyDetailView.Update(record.data)我送record.data到MyDetailView並且可以在xtemplate訪問它們:煎茶觸摸傳遞從組件變量組件
tpl:'<h1>{title}></h1>'
此外,我想在xtype'map'項中使用record.data:
items: [
{
xtype: 'map',
getLocation: true,
padding: '20 0 0 0',
mapOptions: {
center : new google.maps.LatLng(lng, lat), // <-- here record.data.lat
zoom : 15,
mapTypeId : google.maps.MapTypeId.ROADMAP,
navigationControl: true,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.DEFAULT
}
}
}
]
如何訪問MyDetailView中的數據?
感謝
----------------編輯------------------
我添加我的完整代碼。在列表視圖中,我調用AppDetailcard.update(record.data)。
var AppDetailcard = new Ext.Panel ({
id: 'detailcard',
styleHtmlContent: false,
tpl: 'my {lat}', //<-- here it works
fullscreen: true,
dockedItems: [AppDetailcardToolbar],
items : [
{
xtype: 'map',
getLocation: true,
mapOptions: {
center : new google.maps.LatLng(data.lat, data.lng), //<-- here it does not
zoom : 15,
mapTypeId : google.maps.MapTypeId.ROADMAP,
navigationControl: true,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.DEFAULT
}
}
}
]
看着這段代碼,我猜這可能是this.lng&this.lat? –
@MozMorris我忘了提,我沒有成功嘗試過。雖然它不會拋出任何錯誤,但GMap根本不會顯示。 – Matthieu