zl程序教程

您现在的位置是:首页 >  后端

当前栏目

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

继承 解决 分析 原因 Data Store Extjs Ext
2023-06-13 09:14:49 时间
关于这个原因有很多种,我只说下我遇到的
我这样写Store来复用的
复制代码代码如下:

DocStore=Ext.extend(Ext.data.Store,{
initComponent:function(){
this.proxy=newExt.data.HttpProxy({url:this.url});
this.reader=newExt.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里面