Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Stephen Neander on Aug 30, 2009 00:54
open dhtmlx forum
Problem with setTabActive and setContentHref

I get an error when I try to programatically activate a tab that contains content created via setContentHref. The tab is selected but the content isn't displayed. Other content such as grids and layouts works fine with setTabActive.

tabbarChild = dhxLayoutRight.cells("b").attachTabbar();
tabbarChild.setImagePath(dhtmlx_codebase_path+"imgs/");
tabbarChild.setSkinColors("#FCFBFC","#F4F3EE");
tabbarChild.enableAutoReSize(true);
tabbarChild.enableAutoSize(true, true);
tabbarChild.setHrefMode("ajax-html");
tabbarChild.addTab("child_tab_"+param['identifier'],
param['label']+" <img src='<?php echo public_path("images/loader.gif") ?>' alt='Loading...' id='loading_indicator_"+param['identifier']+"' style='height:16px;width:16px;vertical-align: middle; display: none'>","100px");
if (tabbarChild.getActiveTab() == null){
tabbarChild.setTabActive('child_tab_'+paramsChild['default_tab']);
}
.
.
.

The content of the tab is set later as follows:
function doInitPanelChild(param){
var uid="/uid/"+(new Date()).valueOf();
tabbarChild.setContentHref("child_tab_"+param['identifier'], root_module_path+"/"+param['module']+"/show/id/"+current_parent_id+uid);
tabbarChild.forceLoad("child_tab_"+param['identifier']);
}

The error is:
z is undefined
var z=this._content[tab.idd];if (!z._lo...&&(this._content[this._lastActive.idd]))
./js/dhtmlx/codebase/dhtmlxtabbar.js Line 112

The tab id used in addTab is the same the one used in setTabActive.
If I comment out the setTabActive line I can click on the tab and the content displays correctly.
Answer posted by Alex (support) on Aug 31, 2009 03:21
Please, provide the complete demo to recreate the issue. It can be sent to support@dhtmlx.com