Parent Object.

Hi everybody

I need your help to solve this question.

The structue of my application is something like this:

  • Main_layout

  • tabbar_application = Main_layout.cells(“b”).attachTabbar()

The structure of tabbar_application is loaded from xml where i use “href” to load (attachUrl) an html page to each tab.

What i need is this:
From these html pages i need to call Main_layout.cells(“b”).progressOn() but i don’t know how to give the reference to Main_Layout.

Please Help.

Hi
Use

parent.Main_layout.cells("b").progressOn()

Many thanks Darya.

using the structure i explained, i 've another problem. i need to pass a parameter calling the loadStruct of Tabbar and this parameter should be used inside xml in the href definition calling the html pages.
Something like that:

tabbar.loadStruct(xml/tabbar.xml?id=123)

inside xml:

<?xml version="1.0"?>

… PARAMETER

Is it possible ? in wich way ?

Many thanks again.

hi

you can use something like the following:

myTabbar = new dhtmlXTabBar("my_tabbar"); window.dhx4.ajax.get("tabbar.xml", function(r){ myTabbar.loadStruct(String(r.xmlDoc.responseText).replace(/%ID%/g, "123")); });

xml template:

<?xml version="1.0"?> <tabbar align="left" closeButton="1" hrefmode="ajax"> <tab id="a1" width="auto" active="1" href="page1.html?id=%ID%">Tab 1</tab> </tabbar>

Great !!!

Many thanks !

if i have to use many parameters i suppose this is the sintax:

myTabbar.loadStruct(String(r.xmlDoc.responseText).replace(/%ID%|%ID2%|%ID3%/g, “123”|“456”|“789”)); (or “123|456|789”)

XML
Tab 1

Please help

I need to use more parameters at the same time ? Is there e correct syntax to use ?

Thanks

Hi

you can try the following:

var params = {ID: "value", ID2: "value2", ID3: "value3"}; var t = '<tab id="a1" width="auto" active="1" href="page1.html?id=%ID%&id2=%ID2%&id3=%ID3%&id4=%ID4%">Tab 1</tab>'; t = t.replace(/%([a-z0-9]*)%/gi, function(k0,k1){return params[k1]||k0;}); console.log(t)

you also can use dhx4.template - it has a bit different syntax but more possibilities

var text = '<tab id="a1" width="auto" active="1" href="page1.html?id=#ID#&id2=#ID2#&id3=#ID3#&id4=#ID4#">Tab 1</tab>'; var values = {ID: "value", ID2: "value2", ID3: "value3"}; console.log(dhx4.template(text, values));

note, should be # instead of %
more details docs.dhtmlx.com/dhxtemplate.html

thanks Andrei but i found an easier way that could be useful for somebody else.

window.dhx4.ajax.get(“xml/tabbar.xml”, function® {
tabbar.loadStruct(String(r.xmlDoc.responseText.replace(/%ID1%/g,param1).replace(/%ID2%/g,param2).replace(/%ID3%/g,param3), function(){
});
});

Bye