我正在为网格设置一个缓冲渲染器,我有一个存储和一个类似于以下的网格设置:
var ds = new Ext.data.Store({
model: "TestStore",
data: myData,
pageSize: 100,
proxy: {
type: 'memory',
reader: {
type: 'array',
useSimpleAccessors: true
}
}
});
var grid = Ext.widget({
xtype: 'grid',
store: ds,
// ... More setup
autoLoad: true,
plugins: {
ptype: 'bufferedrenderer'
}
})
然而,当我试图在我的程序中加载这个网格时,我得到了以下错误:
Uncaught TypeError: Object #<error> has no method 'indexOf'
在线:
urlAppend : function(url, string) {
if (!Ext.isEmpty(string)) {
return url + (url.indexOf('?') === -1 ? '?' : '&') + string;
}
return url;
},
这是堆栈跟踪:
Ext.String.urlAppend
Ext.apply.urlAppend
Ext.define.setOptions
Ext.define.request
Ext.define.load
Ext.define.constructor
constructor
Ext.define.getLoader
Ext.define.constructor
Base.implement.callParent
Ext.define.constructor
constructor
Ext.apply.widget
我按照文档中建议的方式进行了设置,但无论是在他们的官方文档上,还是在谷歌搜索后通过其他网站,我都找不到任何关于我做错了什么的信息。
不要在网格上使用autoLoad。使用它的正确位置应该是底层数据存储。