私はSenchaTouchを使うのはまったく初めてです。サイドバーとマップペインを備えたアプリを作成しています。ユーザーがサイドバー領域の[マップの表示]ボタンをクリックすると、マップはその場所の中央に配置されます。私が問題を抱えているのは、ハンドラー関数からtpl変数にある{lat}プロパティと{lon}プロパティにアクセスする方法がわからないことです。これが些細な質問である場合はお詫びしますが、私は困惑しています。
Ext.define('Admin.view.Details',
{
extend: 'Ext.Panel',
xtype: 'details',
config:
{
styleHtmlContent: true,
scrollable: 'vertical',
title: 'Individual',
tpl:
[
'Account Number: {comid}',
'<br />',
'Address: ',
'{address} <br />',
'{lat},{lon}',
],
items:
[
{
title: 'Utilities',
items:
[
{
xtype: 'selectfield',
label: 'Utility Type',
options:
[
{text: 'Electricity', value: 'U1'},
{text: 'Water', value: 'U2'},
{text: 'Gas', value: 'u3' },
],
id: 'utilityType',
},
{
xtype: 'selectfield',
label: 'Coverage Area',
options:
[
{text: 'Subdivision', value: 'a1'},
{text: 'Zipcode', value: 'a2'},
{text: 'County', value: 'a3' },
],
id: 'areaType',
},
{
xtype: 'button',
text: 'Show Map',
ui: 'round',
padding:3,
margin:10,
id: 'mapsBTN',
handler: function() {
olMap.setCenter(new OpenLayers.LonLat(lon, lat).transform
(
new OpenLayers.Projection("EPSG:4326"),
olMap.getProjectionObject()
), 16);
}
},
]
},
]
}
});