用户登录
用户注册

分享至

Extjs 继承Ext.data.Store不起作用原因分析及解决

  • 作者: 一念天堂一念地狱30784311
  • 来源: 51数据库
  • 2021-08-02
关于这个原因有很多种,我只说下我遇到的
我这样 写store来复用的
复制代码 代码如下:

docstore = ext.extend(ext.data.store,{
initcomponent:function(){
this.proxy = new ext.data.httpproxy({url:this.url});
this.reader = new ext.data.jsonreader(
{
totalproperty: 'results',
root: 'rows',
id:'docid',
fields: ['docid', 'extention','docname', 'author', 'sizes', 'datecreated']
}

);
this.sortinfo = { field: 'datecreated', direction: 'desc' };
this.remotesort = false;
docstore.superclass.initcomponent.call(this);
}
});

这个store写出来之后 是不会起到作用的
因为ext.data.store这个类 没有继承component 组件 因此在初始化的时候不会调用initcomponet方法的,
因此这里面的配置项也不会加载到store里面
软件
前端设计
程序设计
Java相关