Home > Web Front-end > JS Tutorial > body text

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

WBOY
Release: 2016-05-16 17:36:59
Original
987 people have browsed it

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.
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!