ExtJs auditeurs

Je veux obtenir un événement onload de travail sur ma config objet.

Les ouvrages suivants, sauf lorsque je créer un

config.listeners={..}

( je pense que c'est ce dont j'ai besoin? ) pour remplacer

this.onload({...});

Suis-je encore en utilisant le droit de config? ( En général, je n'ai aucune idée sur la gestion des événements )

Ext.define('data.SimpleStore', {
extend: 'Ext.data.Store'
,constructor: function (config) {
config.url=config.url||"afsud"; //If no call, we assume that url has been passed. Pass neither and be shot
config.id=config.url+'Store';//call should be unique, else its another set of headaches. 
//console.log(config);
Ext.define(config.id+'M', { //for a painful reason, you cant have a store without a model
extend: 'Ext.data.Model',
fields: []//we figure these out anyways
});
config.root=config.root||'data';
config.type=config.type||'json';
config.proxy= config.proxy||{ //note if we override our proxy, then server.php might not work as black magic
type: 'ajax'
,url : config.url
,reader: {
type: config.type//seriously if you want to change this, go away
,root: config.root//we assume. 
}
};
config.model=config.id+'M';//model should match store anyway. Generic models are out of scope atm
config.listeners={
//this.populateFields //Error'd
};
this.callParent([config]);
this.load({//This works, but its after the parent call, so not exactly what i want
callback: function(records,operation,success){
var obj=Ext.decode(operation.response.responseText);     
this.add(obj[config.root]);
console.log(this.getRange());
console.log(config);
}
});
}
,populateFields:function(){
console.log('ran'); //never happens
}
});
var s=   Ext.create('data.Store',{url:'test.php'});
s.load();
InformationsquelleAutor Alex | 2011-07-25