Popup Position shifting in EX_JS Layout

599
3
07-19-2012 04:44 AM
AndrewDavis
New Contributor
I have a map page using the EXT_JS demo that is giving me a problem.
If you look at the demo on
http://help.arcgis.com/en/webapi/javascript/arcgis/demos/framework/framework_extjslayout.html

The left panel collapses and expands, but the state change throws my identify click off by the width horizontally of my expanded panel.

{
region: "west",
title: "Map Content"
width: 200,
split: true,
collapsible: true,
contentEl: "west" 
listeners: {
  collapse: function(){if (map) {map.resize();}}
}
}


I have another panel in the "east" which resizes just fine but does not throw the horizontal measure off for the mouse down event on the map panel.

Does anyone know a work around or method which I can employ?

Andy..
0 Kudos
3 Replies
derekswingley1
Frequent Contributor
It sounds like you're referencing an old version of that sample. The current version has:
{
  region: "west",
  title: "left panel",
  width: 150,
  split: true,
  collapsible: true,
  html: "left panel content. this panel is collapsible and can be resized using the splitter",
  listeners: {
    collapse: resizeMap,
    expand: resizeMap
  }
}


resizeMap is:
function resizeMap() {
  map.resize();
}


IIRC, the sample was updated at the 3.0 release to include the expand event listener to address the problem you're describing.
0 Kudos
AndrewDavis
New Contributor
Thanks..

I will work on getting version 3.0 installed.  I have to run this locally, and will try it tomorrow.

Andy
0 Kudos
AndrewDavis
New Contributor
I installed the 3.0 api, and have fixed the problem desribed above.

Inside the scripting function for the "West" Panel changing the listener line solved the problem.

If I had read more carefully what Derek Swingley had written I could have solved this much earlier.

So.. My region West should read

{
region: "west",
Title: "Map Content",
width: 200,
split: true,
collapsible: true,
collapsed: true, // I like it collapsed on startup
contentEl: "west",
listeners: {
collapse: function() {if (map) {map.resize();} },
expand: function() {if (map) {map.resize();} }
}

Can I still award points to Derek Swingley ?


Andy..
0 Kudos