0

在其中一个窗口中,我将搜索类型作为参数传递。之后,我在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. ');

                                }
                            }
                        }
                    });

谁能帮我重新组织代码。提前致谢

4

0 回答 0