在其中一个窗口中,我将搜索类型作为参数传递。之后,我在 mcmFindCityPair 中获取搜索类型,并传递 mcmFocusMarketStore 存储。我需要在名为 mcmFocusMarketStore 的商店中传递搜索类型。我传入了商店,但它说没有定义searchType。任何人都可以帮我重新组织代码。 摘录如下:
window.js 这是代码......
App.mcmFindCityPair(this.mcmSearchType, this.mcmOriginTextbox.getValue(),
this.mcmDestinationTextbox.getValue(),this.mcmStartDateTimeField.getValue(),
this.mcmEndDateTimeField.getValue());
app.js 这是代码
mcmFindCityPair : function(searchType, org, dest, start, end) {
App.mcmFocusMarketStore.removeAll(true);
var startDate = start ? Ext.Date.format(start, 'd-M-y H:i') : '';
var endDate = end ? Ext.Date.format(end, 'd-M-y H:i') : '';
console.log(searchType);
App.mcmFocusMarketStore.proxy.url = getProxyUrl()
+ "&action=getFMFlights&searchType="+searchType
+ ("&origin=" + org)
+ ("&destination=" + dest)
+ (startDate ? ("&startDate=" + startDate) : '')
+ (endDate ? ("&endDate=" + endDate) : '');
console.log(App.mcmFocusMarketStore.proxy.url);
App.mcmFocusMarketStore.load();
App.mcmAllFocusMarketStore.removeAll(true);
App.mcmAllFocusMarketStore.proxy.url = getProxyUrl()
+ "&action=getFMFlights&searchType="+searchType;
App.mcmAllFocusMarketStore.load();
}
App.mcmFocusMarketStore = Ext.create(
'Ext.data.Store',
{
model : 'FocusMarketModel',
proxy : {
timeout : AJAX_TIMEOUT,
type : 'jsonp',
url : getProxyUrl()
+ "&action=getFMFlights&searchType="+ searchType,
reader : {
type : 'focusmarketReader',
root : 'success',
totalProperty : 'total'
},
listeners : {
exception : function(proxy, exception,
operation) {
alert('Failed to get any kind of response from server! The application will be restarted. ');
}
}
}
});
任何人都可以帮我重新组织代码。提前致谢