Home >Web Front-end >JS Tutorial >Extjs inheritance Ext.data.Store does not work reasons analysis and solution_extjs

Extjs inheritance Ext.data.Store does not work reasons analysis and solution_extjs

WBOY
WBOYOriginal
2016-05-16 17:36:591080browse

There are many reasons for this, I will only talk about what I encountered
I wrote Store like this to reuse

Copy code The code is as follows:

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);
}
});

This Store will not work after it is written
Because the Ext.data.Store class does not inherit the component component, the initComponet method will not be called during initialization.
So the configuration items here will not be loaded into the Store.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn