PDA

View Full Version : [3.0]event for a tabpanel after everytab is loaded



axelaxel
21 Oct 2009, 5:18 AM
Hi guys,
i have a question for you.

i have a tabpanel, wih some tabs, and every tab has on its activate event has a load operation of an url (to put contents in the tab)

i need to keep disabled the tabs of the tabpanel until every tab is loaded.

but i couldn't find any event for the tabpanel, and i have no idea how to handle it, i thought about the callback function of the load operation, but it's not precise, because i need all the tab to be loaded, and before i don't know which tab will be the last to end.

i hope to have been clear.

thank you all


axel

jay@moduscreate.com
21 Oct 2009, 5:26 AM
Tappanel does not listen or relay events for the updater for every child panel.

axelaxel
21 Oct 2009, 5:30 AM
i feared it....
anyway thank you

jay@moduscreate.com
21 Oct 2009, 5:31 AM
But that's not to say that *you* couldn't do it yourself!

Animal
21 Oct 2009, 5:44 AM
Panel should really relay the update event so that you can tell when it has loaded any content:



Ext.override(Ext.Panel, {
/**
* Get the {@link Ext.Updater} for this panel. Enables you to perform Ajax updates of this panel's body.
* @return {Ext.Updater} The Updater
*/
getUpdater : function(){
if (!this.updater)
this.updater = this.body.getUpdater();
this.relayEvents(this.updater, 'update');
}
return this.updater;
},

/**
* Loads this content panel immediately with content returned from an XHR call.
* @param {Object/String/Function} config A config object containing any of the following options:
<pre><code>
panel.load({
url: 'your-url.php',
params: {param1: 'foo', param2: 'bar'}, // or a URL encoded string
callback: yourFunction,
scope: yourObject, // optional scope for the callback
discardUrl: false,
nocache: false,
text: 'Loading...',
timeout: 30,
scripts: false
});
</code></pre>
* The only required property is url. The optional properties nocache, text and scripts
* are shorthand for disableCaching, indicatorText and loadScripts and are used to set their
* associated property on this panel Updater instance.
* @return {Ext.Panel} this
*/
load : function(){
var um = this.getUpdater();
um.update.apply(um, arguments);
return this;
},

// private
doAutoLoad : function(){
var u = this.getUpdater();
if(this.renderer){
u.setRenderer(this.renderer);
}
u.update(Ext.isObject(this.autoLoad) ? this.autoLoad : {url: this.autoLoad});
}
});


Then you could set Panel to bubble the update event, and then you could just use a listener on the TabPanel.

axelaxel
21 Oct 2009, 5:45 AM
any starting suggestions?

Animal
21 Oct 2009, 5:48 AM
Use that override, bubble the update event

jay@moduscreate.com
21 Oct 2009, 5:53 AM
can you make this an official request?