Select to view content in your preferred language

Help with Multiple Tabs in DOJO Codes on InfoWindow.

1104
4
03-22-2011 06:49 PM
Sophialim
Emerging Contributor
Hi, we're relatively new to these codes so we're trying our best to use it.

How do you code the infoWindow with multiple tabs with javaScript using the codes that we have below?

Part of our codes for the infoWindow:
dojo.connect(graphic, "onClick", function(evt){
g = evt.graphic;
map.infoWindow.setTitle();
map.infoWindow.show(evt.screenPoint,map.getInfoWindowAnchor(evt.screenPoint));
map.infoWindow.resize(260,130);

We've searched for codes with the link below but how do we implement it into our codes above?

Link which we're referring to:
http://dojotoolkit.org/api/dijit.layout.TabContainer

Please respond ASAP, urgent!
Thanks.
0 Kudos
4 Replies
derekswingley1
Deactivated User
0 Kudos
jamiehollingsworth
Emerging Contributor
this example helped me

http://help.arcgis.com/en/webapi/javascript/arcgis/demos/widget/widget_infowindowchart.html

here is my tab function
function getWindowContent(graphic) {
        //make a tab container
        var tc = new dijit.layout.TabContainer({
          style: "height: 100%; width: 100%;"
        }, dojo.create("div"));
       
        //display tab 1
        var cp1 = new dijit.layout.ContentPane({
          title: "Details",
          content: "<a target='_blank' href=${HTML}>Go There</a>"
    });
        tc.addChild(cp1);
     
       //display tab 2
        var cp2 = new dijit.layout.ContentPane({
          title: "Location",
    content: "latitude: " + graphic.attributes.LAT + "<br />longitude: " + graphic.attributes.LON + ""
        });
        tc.addChild(cp2);
  return tc.domNode;
  }

good luck
0 Kudos
Sophialim
Emerging Contributor
swingley: But i not using REST, is there another code way, or can u show mie hw to hardcode with the code i hav above and i try to change it
Also i want to click on the icon that i put then show the infoWindow with the multipy tab in , cause the link you show me is directly click on the map then the window i want appear
And
jamiehollingsworth : i try out yours, but return tc.domNode, where does the domNode come from...
and your function getWindowContent(graphic), where will it be use/add in at so that this function can be use

Thanks alot !
Please Respond ASAP!
0 Kudos
Sophialim
Emerging Contributor
this example helped me

http://help.arcgis.com/en/webapi/javascript/arcgis/demos/widget/widget_infowindowchart.html

here is my tab function
function getWindowContent(graphic) {
        //make a tab container
        var tc = new dijit.layout.TabContainer({
          style: "height: 100%; width: 100%;"
        }, dojo.create("div"));
       
        //display tab 1
        var cp1 = new dijit.layout.ContentPane({
          title: "Details",
          content: "<a target='_blank' href=${HTML}>Go There</a>"
    });
        tc.addChild(cp1);
     
       //display tab 2
        var cp2 = new dijit.layout.ContentPane({
          title: "Location",
    content: "latitude: " + graphic.attributes.LAT + "<br />longitude: " + graphic.attributes.LON + ""
        });
        tc.addChild(cp2);
  return tc.domNode;
  }

good luck


hey wad is i try out le, but cant work help miie why la
i hav attach a notepad with my code in
0 Kudos