PDA

View Full Version : Extending Panel which is built upon store ...



keckeroo
19 May 2011, 10:25 AM
I would like to 'build' a panel (extend) that has a store associated with it - I was wondering if anyone had any insight as to how to 'delay' the creation of the panel until after the store is loaded with information as the contents of the loaded record will determine information used to build the panel ..

This is what I have - but it is not entirely working and not sure if this can be done at all. Thanks!
PS - code is 'paraphrased' somewhat ;-)



Ext.ux.newpanel = Ext.extend(Ext.Panel, {

constructor: function(config) {
Ext.apply(this, config);

this.store = new mystore({
url: 'my url',
autoLoad: {
params: { stuff: here },
callback: function() {
Ext.ux.newpanel.superclass.constructor.call(this);
}
});
},

initComponent: function() {
// more building stuff here ...

Ext.apply(this, {
html: 'new panel stuff'
});

Ext.ux.newpanel.superclass.initComponent.call(this);
}
});



I'm just sooooo close - but no cigar. As I mentioned - i want to 'delay' the creating of the panel until the store is loaded so that i can build it according to info in the retrieved record.

Thanks :-)

Kevin