orla
21 Sep 2006, 11:05 AM
Hi there
I've got a tab panel with a couple of tabs each of which have their content loaded using setUrl. The page that the url points to contains a grid and I'm calling grid initialisation function from the onUpdate method of the tabs UpdateManager.
The first time the page loads, the call to initialise the grid fails on grid.render() however subsequent tabbing works correctly and the grid successfully loads.
If I put in some kind of a delay before the grid.render (say an alert() call) the grid loads without problem, so I'm wondering if I'm using the wrong event to trigger the grid initialisation - is there another event that is fired after the url pointed to by the tab has been loaded?
The page with the TabPanel has the follwoing
var tabPanel = new YAHOO.ext.TabPanel('tabPanel');
var load_grid = function(type) {
Grid.init('grid-div', datamodel-target);
};
var tab = tabPanel.addTab('my_tab', 'my_tab');
tab.setUrl(tab-url, null, false);
var mgr = tab.getUpdateManager();
mgr.onUpdate.subscribe(load_grid);
And the page pointed to by the url has the grid div tag <div></div>
Any help would be appreciated
Thanks
O.
I've got a tab panel with a couple of tabs each of which have their content loaded using setUrl. The page that the url points to contains a grid and I'm calling grid initialisation function from the onUpdate method of the tabs UpdateManager.
The first time the page loads, the call to initialise the grid fails on grid.render() however subsequent tabbing works correctly and the grid successfully loads.
If I put in some kind of a delay before the grid.render (say an alert() call) the grid loads without problem, so I'm wondering if I'm using the wrong event to trigger the grid initialisation - is there another event that is fired after the url pointed to by the tab has been loaded?
The page with the TabPanel has the follwoing
var tabPanel = new YAHOO.ext.TabPanel('tabPanel');
var load_grid = function(type) {
Grid.init('grid-div', datamodel-target);
};
var tab = tabPanel.addTab('my_tab', 'my_tab');
tab.setUrl(tab-url, null, false);
var mgr = tab.getUpdateManager();
mgr.onUpdate.subscribe(load_grid);
And the page pointed to by the url has the grid div tag <div></div>
Any help would be appreciated
Thanks
O.