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
1 Answer 1
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.
-
genius, thank you! Out of interest, can you link to any examples where you've used it?Stephen Lead– Stephen Lead2011年07月15日 00:56:20 +00:00Commented 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)Stephen Lead– Stephen Lead2011年07月15日 01:17:41 +00:00Commented 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.D.E.Wright– D.E.Wright2011年07月15日 02:45:50 +00:00Commented Jul 15, 2011 at 2:45
-
1no problems, you've already made my dayStephen Lead– Stephen Lead2011年07月15日 04:09:31 +00:00Commented Jul 15, 2011 at 4:09