2
我有一個關於xtypes的問題。當我這樣做:Sencha xtype方法
// map
var map = new Ext.map({
fullscreen: true,
getLocation: true,
mapOptions: {
zoom: 12
}
});
map.map.setCenter(new google.maps.LatLng(record.attributes.record.data.latitude, record.attributes.record.data.longitude));
一切都很好,地圖顯示。
現在,當我使用xtypes時,'map'變量將無法識別'setCenter'屬性。 代碼: VAR地圖= { 全屏:真實, 的xtype: '地圖', 標題: '地圖', 的getLocation:真實, useCurrentLocation:真實, 的MapOptions: { 變焦:12 } };
map.map.setCenter(new google.maps.LatLng(record.attributes.record.data.latitude, record.attributes.record.data.longitude));
有了這個代碼,我得到這個在控制檯:
Uncaught TypeError: Cannot call method 'setCenter' of undefined
我希望有人能幫助我。提前致謝!
謝謝您的回答!我正在玩xtypes,現在我和麪板一樣。 //描述 變種描述= { \t的xtype: '面板', \t TPL: '{TITLE}' }; \t \t \t \t \t \t \t description.update(record.attributes.record.data); 這給了我一個錯誤,方法'更新'不知道...我是否必須以同樣的方式解決這個問題? – Voles 2011-04-04 11:17:50
是的,我相信是的。在文檔中,您可以查看可插入面板的不同事件(例如,maprender是Map的事件)。 – Nicodemuz 2011-04-04 15:57:32