Javascript 使用带存储的Extjs代理解析命名空间方法时出错
我正在尝试将我的网格与一个存储链接起来,该存储使用代理连接到某个外部源。我是这样设置的:Javascript 使用带存储的Extjs代理解析命名空间方法时出错,javascript,extjs,extjs4,Javascript,Extjs,Extjs4,我正在尝试将我的网格与一个存储链接起来,该存储使用代理连接到某个外部源。我是这样设置的: Ext.define('js.dmwf.PackageStore', { extend: 'Ext.data.JsonStore', model: 'js.model.Package', remoteFiler : false, remoteSort: false, autoLoad: true, proxy: { type: 'json'
Ext.define('js.dmwf.PackageStore', {
extend: 'Ext.data.JsonStore',
model: 'js.model.Package',
remoteFiler : false,
remoteSort: false,
autoLoad: true,
proxy: {
type: 'json',
url : 'mock/GetPackageListBB.json',
reader: {
type: 'json'
},
} });
然而,我得到了一个错误。这发生在ext all debug中的parseNamespace函数中
Uncaught TypeError: Cannot read property 'substring' of undefined
ext-all-debug.js:5043
Ext.ClassManager.parseNamespace ext-all-debug.js:5043
我有一种感觉,我错过了一两个要点。然而,我认为我拥有一切:
Ext.require([
'Ext.data.*',
'Ext.data.proxy.*',
'Ext.data.reader.*',
'Ext.grid.*',
'Ext.tree.*',
'Ext.ux.grid.FiltersFeature',
'Ext.toolbar.Paging',
'Ext.ux.form.SearchField',
'Ext.util.*',
'Ext.state.*'
// 'Ext.ux.grid.Search'
]);
我也有一把小提琴:
代理类型必须是“ajax”
我猜代理数据应该是这样的,代理:{type:'ajax',url:local?url.local:url.remote,读卡器:{type:'json',root:'data'},
proxy: {
type: 'ajax',
...
}