0
有人能告訴我如何以sencha touch的形式將數據從控制器傳遞到數據存儲。如何在sencha touch中將控制器的值傳遞給數據存儲
視圖代碼
var select = new Ext.form.Select({
id:'selectCity',
store: parking.stores.city,
displayField: 'Name',
valueField: 'Name',
placeHolder: 'Choose City',
cls:'select'
});
var citySearchButton = new Ext.Button({
cls: 'citySearch',
text: 'Search',
handler: function() {
Ext.dispatch({
controller: parking.controllers.controller,
action: 'showMapBasedOnCity',
id: Ext.getCmp('selectCity').getValue()
});
}
});
從我的觀點,我能夠值傳遞給控制器。
showMapBasedOnCity: function (options) {
var city = options.id;
//var data = parking.stores.parkingFacilityByCity.setId(city);
// parking.views.map.addMap(city);
parking.views.viewport.setActiveItem(
parking.views.map, options.animation
);
},
的問題是如何從這裏傳遞價值的數據存儲:我需要從控制器(城市值)的參數傳遞給我的JSONP查詢以獲得所需結果返回)。
parking.stores.parkingFacilityByCity = new Ext.data.Store({
model: 'PF',
proxy: Ext.util.JSONP.request({
url: 'http://parking.511.org/index/M_GetParkingFacilityByCity',
callbackKey: 'callback',
parmas: { city: },
scope: this,
callback: function (data) {
var list = data.Root;
parking.stores.parkingFacilityByCity.loadData(data.Root);
}
})
});
任何幫助將不勝感激。
感謝, 爬完