0

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

asked Jul 15, 2011 at 0:36

1 Answer 1

2

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.

answered Jul 15, 2011 at 0:45
4
  • genius, thank you! Out of interest, can you link to any examples where you've used it? Commented Jul 15, 2011 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) Commented Jul 15, 2011 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. Commented Jul 15, 2011 at 2:45
  • 1
    no problems, you've already made my day Commented Jul 15, 2011 at 4:09

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.