0

我尝试加载商店,但由于某种原因,我在 Google Chrome(最新版本)中收到此错误:

Uncaught TypeError: Cannot call method 'apply' of undefined ext-all-debug.js:8586
fire ext-all-debug.js:8586
Ext.define.continueFireEvent ext-all-debug.js:24623
Ext.define.fireEvent ext-all-debug.js:24601
Ext.define.onProxyLoad ext-all-debug.js:50186
Ext.define.processResponse ext-all-debug.js:39168
(anonymous function) ext-all-debug.js:39381
Ext.apply.callback ext-all-debug.js:6422
Ext.define.handleResponse ext-all-debug.js:18769
(anonymous function) ext-all-debug.js:1815
(anonymous function)

这个在 Internet Explorer 8 中:

Message: 'fireFn' is null or not an object

而 FireFox(最新版本)似乎忽略了它。

我在 中插入了一些新行ext-all-debug.js,因此行号可能会偏离 5-10 行。

这是商店:

Ext.define("FI.store.units.InstallBaseStore", {
extend:'Ext.data.Store',
requires: "FI.model.units.InstallBaseModel",

            model: "FI.model.units.InstallBaseModel",
            storeId: 'installBaseStore',
            pageSize:10,
            proxy: {
                type: 'jsonp',
                url: urls.QSUrl+"/search",
                limitParam: 'undefined',
                startParam: 'offSet',
                pageParam: 'undefined',
                extraParams: {
                    searchString: '*:*',
                    index: "fleet",
                    role: "Admin"
                },

                 reader: {
                        root: 'results.results',
                        totalProperty: 'numFound',
                        model: 'FI.model.units.InstallBaseModel'
                    }
            },

            listeners:{
                beforeload: {
                    fn:function(){
                        console.log("BEFORE LOAD");
                        this.getProxy().setReader({
                        root: 'results.results',
                        totalProperty: 'numFound',
                        model: 'FI.model.units.InstallBaseModel'
                    });
                        console.log(this.getProxy().getReader());
                    }
                }
            }
        });

有任何想法吗?

4

1 回答 1

0

将代理放入模型中,然后像这样对阅读器进行操作:

...
proxy:{
  type:'ajax',
  url:'...',
  reader:{
    type:'json',
    root:'...'
  }
}
于 2012-07-05T16:07:39.810 回答