Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Beginner of Dhtmlx on Apr 20, 2009 20:48
open dhtmlx forum
Go to specific tab from an external link

Hi,

If I want to go to specific tab from an external link, how would I set througth with using html anchor
<a href="#" onclick=javascript function>Tab #3</a>

what should i have under the javascript function, where the page does not initial the tabbar.


Answer posted by Alex (support) on Apr 21, 2009 03:19

Hello, 

In this case you should open the page with tabbar and set the necessary tab active (after tabbar intialization):

tabbar.setTabActive(tab_id); 

Answer posted by dhtmlbeginner on Apr 21, 2009 03:25

yes, but that is only limited if they are under the same tabbar.

let say I have one tabbar at each page(page1 and pages2), each page has its own tabbar.

it is possible for me to go from page1-tab2 to page2-tab4 ?

 

Answer posted by Alex (support) on Apr 21, 2009 05:11

Do you mean that there are pages inside your tabbar (inside tabbar iframes) and you want to call tabbar method from these pages ?

If you do, tabbar method can be called from iframe as follows:

parent.tabbar.setTabActive(tab_id);

Answer posted by Alex (support) on Apr 21, 2009 05:21

Possibly the following can be used:

window.open(page1?tab_id=tab2_id);

or

window.open(page2?tab_id=tab4_id);

It means that you can path the id of the tab which must be open as the parameter. 

Answer posted by dhtmlbeginner on Apr 22, 2009 00:51

it works now, but another problem arise.

When I switch the tab within the same page, my url address still got the same one that has my tab_id=tab 4

I would like to have the parent url rather than the one with tad_id parameter once tab is being switch ??

 

 

Answer posted by Alex (support) on Apr 22, 2009 05:40

You can reload page using  following method:

tabbar.setContentHref(tab_id,new_href)