Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

This applies to ArcGIS Server JavaScript API 2.4. The Build Application Layouts help file shows how to lay out a page with elements held within separate containers.

How can I programatically close a Content Pane when the user presses a button?

For example in this map, how could I close the rightPane div, and have the map expand to fill the vacant space (ie, hide the Table of Contents)?

ESRI are doing it on the My Map viewer so it must be possible. The X in the top-right of the Details panel contains this markup:

<a title="Close" href="JavaScript:esri.arcgisonline.map.main.hideLeftContentPanel();">
    <img border="0" src="images/close.gif">
</a>

How can I find out what that button is doing, and would that help?

Thanks

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Ok, what you want to do is use the dojox.layout.ExpandoPane, then you will do a method like this in your :

dojo.connect(dijit.byId('myExpandoPage'), 'resize', resizeMap);

This will tell your app to use the resizeMap method each time the pane gets resized. I use this in several of my apps and it works pretty slick, and can be tweaked nicely with css.

share|improve this answer
    
genius, thank you! Out of interest, can you link to any examples where you've used it? –  Stephen Lead Jul 15 '11 at 0:56
    
also, any tips for putting the pane to the right? If I use <div region="right" dojoType="dojox.layout.ExpandoPane"... it correctly shows on the right, and the min/max arrows orient correctly, but the animation is backwards (ie, it minimizes from right-to-left) –  Stephen Lead Jul 15 '11 at 1:17
    
Sorry, the apps that use this are secure/official state apps. And I have always had my task/operation area on the left edge, so I never noticed the sliding method. You might seem here packtlib.packtpub.com/library/9781847192684/ch06lvl1sec05 some more information, sorry I can't give you more. –  D.E.Wright Jul 15 '11 at 2:45
1  
no problems, you've already made my day –  Stephen Lead Jul 15 '11 at 4:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.