Extra long time to load a tab using tabbar

Hi All,

I have implemented a page with three tabbars, and the first tab in the second tabbar is taking an extraordinary amount of time to load (approx 15 seconds!)

The tabbar initialization code is:

var tab_sf_record_loaded = false;
var tab_mail_open_loaded = false;
var tab_mail_cthru_loaded = false;

function makeRuleConditionsTabbar() {
dhtmlx_rule_conditions_tabbar = new dhtmlXTabBar(“dhtmlx_rule_conditions”, “top”);
dhtmlx_rule_conditions_tabbar.setSkin(‘dhx_skyblue’);
dhtmlx_rule_conditions_tabbar.setImagePath("/js/dhtmlx/dhtmlxTabbar/codebase/imgs/");
dhtmlx_rule_conditions_tabbar.addTab(“tab_sf_record”, ‘Salesforce Record’, “150px”);
dhtmlx_rule_conditions_tabbar.addTab(“tab_mail_open”, ‘Mail:Open’, “150px”);
dhtmlx_rule_conditions_tabbar.addTab(“tab_mail_cthru”, ‘Mail:Click-Through’, “150px”);
dhtmlx_rule_conditions_tabbar.setHrefMode(“ajax-html”);
dhtmlx_rule_conditions_tabbar.attachEvent(“onSelect”,conditionTabSelected);
dhtmlx_rule_conditions_tabbar.setTabActive(“tab_sf_record”);
}

function conditionTabSelected(tab_id, last_tab_id) {
if (tab_id == ‘tab_sf_record’) {
if (!tab_sf_record_loaded) {
dhtmlx_rule_conditions_tabbar.setContentHref(“tab_sf_record”, “/test/sf/tab/fu_rule/edit/tabs/condition/sf_record.php?user_id=”+user_id+"&rule_based_on="+rule_based_on+"&rulebase_id="+rulebase_id+"&rule_id="+rule_id+"&sf_rule_id="+sf_rule_id+"&ah_sess_id="+ah_sess_id);
tab_sf_record_loaded = true;
}
}
else if (tab_id == ‘tab_mail_open’) {

}
else if (tab_id == ‘tab_mail_cthru’) {

}
return true;
}

The source file for the ‘sf_record’ tab contains some Javascript initialization - and it is this initialization which is taking a long time.

The Firebug profiler shows the functions are taking the most time. Typically waitLoadFunction() in dhtmlxcommon.js and attachURL() in dhtmlxcontainer.js are the main culprits.

An example of the page is available at bit.ly/belzdT - please log in with dhtmlx/dhtemp1 to get access.

Does anyone have any suggestions about the best way to load a tab that needs Javascript initialization? Somehow something seems to be timing out - my take on why it is taking so long.

Thanks

Colin

Hi,

I’ve checked the page - the loading time of the 1st tab is 1.2 sec.

Actually the approach that you use is correct - only active tabs a loaded. There is no way improve performance (at least from tabbar side).

Hi,

Thank you for your response. I am still confused, though. I have Firebug in Firefox but even when it is disabled I get a long wait time (14 seconds). In Internet Explorer it is approx 2 seconds. Does Firebug interfere even when it is not enabled for a site, perhaps?

Colin

The loading of tabbar content takes 1.2 s. However, all libraries and content take 14 sec (total time that is detected in firebug)… You use compressed versions of dhtmlx libraries. So, don’t know what could be done to make the loading faster.

Does Firebug interfere even when it is not enabled for a site, perhaps?

If the Firebug isn’t opened but active, it could interfere. But if it disabled, the problem can not occur. But in any case the Firebug can not make loading 10 times slower…

I have tested it in IE and Chrome, and also on another machine, and it is not slow - approx 1 second. So I do think that Firebug is perhaps slowing it down. But I will review the code again to see if I can detect anything.

Thank you again for your responses - I do appreciate it.

Colin