PDA

View Full Version : Multiple Ext.data.Store extended class but juste one model?



newmind@free.fr
28 Oct 2011, 6:49 AM
Hello,
I create a class that extends ext.data.store. I create two other classes that extend the first. Oddly the two derived classes share thesame model :

Class 1 (Mother) :


Ext.define('Appli.store.GridFilter',{
extend:'Ext.data.Store',
proxy : {
actionMethods :{
read:'post'
},
type:'rest',
reader : {
type: 'json',
root: 'rows'
}
},



constructor: function(config) {


this.callParent([config])
return this;
}

});


Class 2 :

Ext.define('Di.store.logExec.GridFilter',{
extend:'Appli.store.GridFilter',
model: 'Di.model.logExec.GridFilter',
constructor:function(config){
this.proxy.url = '/di/LogExecFindGrid/read/';
this.callParent(arguments);
return this;
}

});


Class 3 :


Ext.define('Di.store.tache.GridFilter',{
extend:'Appli.store.GridFilter',
model:'Di.model.tache.GridFilter',
constructor:function(config){
this.proxy.url ='/di/TacheFindGrid/read/';
this.callParent(arguments);
return this;
}
});


If I use the config property, then it works :

Class 1 (Mother) :


Ext.define('Appli.store.GridFilter',{
extend:'Ext.data.Store',
config:{
proxy:{
actionMethods :{
read:'post'
},
type:'rest',
reader: {
type: 'json',
root: 'rows'
}
}
},
constructor: function(config) {
this.initConfig(config);
this.callParent([config])
return this;
}

});

class 2 :


Ext.define('Di.store.logExec.GridFilter',{
extend:'Appli.store.GridFilter',
config:{
model:'Di.model.logExec.GridFilter',
proxy:{
url :'/di/LogExecFindGrid/read/'
}
}
});

Class 3 :


Ext.define('Di.store.tache.GridFilter',{
extend:'Appli.store.GridFilter',
config:{
model:'Di.model.tache.GridFilter',
proxy:{
url :'/di/TacheFindGrid/read/'
}
}



});


Can you help me?

skirtle
28 Oct 2011, 7:00 AM
What makes you think that they share the same model?