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