Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Frank Lin on Jan 04, 2009 02:53
open dhtmlx forum
change tabBar


same question as http://www.dhtmlx.com/docs/products/kb/index.shtml?cat=7&page=4&q=2227

at 'service.html' have a link, after click it, 'Register' tab should be activated.
do as u said,
<a href="javascript:'tabbar' .setTabActive(a3)" > Link </a>

Error: 'tabbar' not defined !!


=== start.html ===
<html>
<head>
<title>start.html</title>
<link rel="STYLESHEET" type="text/css" href="dhtmlxSuite/dhtmlxTabbar/codebase/dhtmlxtabbar.css">
<link rel="STYLESHEET" type="text/css" href="dhtmlxSuite/dhtmlxTree/codebase/dhtmlxtree.css">
    <script type="text/javascript" src="dhtmlxSuite/dhtmlxTabbar/codebase/dhtmlxcommon.js"></script>
    <script type="text/javascript" src="dhtmlxSuite/dhtmlxTabbar/codebase/dhtmlxtabbar.js"></script>
</head>
<body>
<div id="a_tabbar" style="width:100%;height:'100%';"></div>

<script>
tabbar=new dhtmlXTabBar("a_tabbar","top");
tabbar.setImagePath("dhtmlxSuite/dhtmlxTabbar/codebase/imgs/");
tabbar.setStyle("modern"); //winScarf, winDflt, Silver, Modern, winRound, winBiScarf, winScarf, winDflt
tabbar.setAlign("right"); //left,right,top,bottom
tabbar.setMargin("5");
tabbar.setOffset("3");
tabbar.loadXML("xml/tabs_master.xml");
</script>
</body>
</html>

=== tabs_master.xml ===
<?xml version="1.0" encoding="utf-8"?>
<tabbar hrefmode="iframe">
<row>
<tab id="a4" width='100px' href="resource.html">Resource</tab>
<tab id="a3" width='100px' href="register.html">Register</tab>
<tab id="a2" width='100px' href="Service.html">Service</tab>
<tab id="a1" width='100px' href="tabs_a1.html" selected="1">HomePage</tab>
</row>
</tabbar>
Answer posted by Support on Jan 09, 2009 09:36
Because page loaded in child frame, it must refer to object through "parent"

<a href="javascript:parent.tabbar.setTabActive(a3)" > Link </a>