[英]Why do I get "no method 'indexOf'" error when trying to use a Buffered Renderer on a grid in ExtJS4.2
I'm tying to set up a Buffered Renderer for a grid, I have a store and a grid set up similar to the following:我想为网格设置缓冲渲染器,我有一个商店和一个类似于以下设置的网格:
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'
}
})
When I try to load this grid in my program however, I get the following error:但是,当我尝试在程序中加载此网格时,出现以下错误:
Uncaught TypeError: Object #<error> has no method 'indexOf'
On this line:在这一行:
urlAppend : function(url, string) {
if (!Ext.isEmpty(string)) {
return url + (url.indexOf('?') === -1 ? '?' : '&') + string;
}
return url;
},
Here is the stack trace:这是堆栈跟踪:
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
I've followed the setup the way the documentation suggests here , but I can't find anything about what I'm doing wrong either on their official docs, or through other sites after some googling.我已经按照文档在这里建议的方式进行了设置,但是在他们的官方文档或谷歌搜索后通过其他网站找不到任何关于我做错了什么的信息。
Don't use autoLoad on the grid.不要在网格上使用 autoLoad。 The correct place to use it, should be the underlying data store.
正确使用它的地方应该是底层数据存储。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.