I ran a quick test using the code from David's blog and the 2.5 compact build and it worked for me. Can you provide more details about the problems you are seeing? Here's a link to my test case:http://jsfiddle.net/mZEpZ/And here's the code:
<html>
<head>
<title>
Complex Layout
</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.5/js/dojo/dijit/themes/claro/claro.css"
/>
<link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.2.1/resources/css/ext-all.css"
/>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.5/js/esri/dijit/css/Popup.css"
/>
<style type="text/css">
html, body { font:normal 12px verdana; margin:0; padding:0; border:0 none;
overflow:hidden; height:100%; } p { margin:5px; } .settings { background-image:url(JS/ExtJS/examples/shared/icons/fam/folder_wrench.png);
} .nav { background-image:url(JS/ExtJS/examples/shared/icons/fam/folder_go.png);
}
</style>
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.5compact"
type="text/javascript">
</script>
<script type="text/javascript" src="http://extjs.cachefly.net/ext-3.2.1/adapter/ext/ext-base.js">
</script>
<script type="text/javascript" src="http://extjs.cachefly.net/ext-3.2.1/ext-all.js">
</script>
<script type="text/javascript">
dojo.require("esri.map");
dojo.require("esri.layers.FeatureLayer");
dojo.require("esri.dijit.Popup");
var map;
function init() {
var viewport = new Ext.Viewport({
layout: "fit",
title: "Medford GIS",
items: [{
layout: "border",
items: [{
region: "center",
title: "center",
html: "<div id='map' style='height:100%; width:100%;z-index=: 1000;'></div>"
}, {
region: "north",
title: "north",
height: 100,
collapsible: true,
margins: {
top: 0,
right: 0,
bottom: 0,
left: 0
},
cmargins: {
top: 0,
right: 0,
bottom: 0,
left: 0
},
html: "Header section"
}, {
region: "south",
title: "south",
height: 80,
collapsible: true,
contentEl: "south" // this gets the content from the div named "south"
}, {
region: "west",
title: "west",
width: 150,
split: true,
collapsible: true,
html: "west region"
}, {
region: "east",
title: "east",
width: 150,
split: true,
collapsible: true,
html: "east region"
}]
}],
json: {
size: {
width: 800,
height: 600
}
}
});
var startExtent = new esri.geometry.Extent(-83.41, 31.98, -78.47, 35.28, new esri.SpatialReference({
wkid: 4326
}));
var popup = new esri.dijit.Popup(null, dojo.create("div"));
map = new esri.Map("map", {
extent: esri.geometry.geographicToWebMercator(startExtent),
infoWindow: popup
});
//Add the topographic layer to the map. View the ArcGIS Online site for services http://arcgisonline/home/search.html?t=content&f=typekeywords:service
dojo.connect(map, 'onLoad', function(theMap) {
dojo.connect(window, 'resize', map, map.resize);
});
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer");
map.addLayer(basemap);
var infoTemplate = new esri.InfoTemplate();
infoTemplate.setContent("<b>${NAME}</b><hr></br><b>2000 Population: </b>${POP2000:NumberFormat}<br/>" + "<b>2000 Population per Sq. Mi.: </b>${POP00_SQMI:NumberFormat}<br/>" + "<b>2007 Population: </b>${POP2007:NumberFormat}<br/>" + "<b>2007 Population per Sq. Mi.: </b>${POP07_SQMI:NumberFormat}");
var southCarolinaCounties = new esri.layers.FeatureLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3", {
mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
infoTemplate: infoTemplate,
outFields: ["NAME", "POP2000", "POP2007", "POP00_SQMI", "POP07_SQMI"]
});
southCarolinaCounties.setDefinitionExpression("STATE_NAME = 'South Carolina'");
var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 255, 255, 0.35]), 1), new dojo.Color([125, 125, 125, 0.35]));
southCarolinaCounties.setRenderer(new esri.renderer.SimpleRenderer(symbol));
map.addLayer(southCarolinaCounties);
//NOTE: Requires dojo.number for the formatting
var infoTemplate = new esri.InfoTemplate();
infoTemplate.setContent("<b>${NAME}</b><hr></br><b>2000 Population: </b>${POP2000:NumberFormat}<br/>" + "<b>2000 Population per Sq. Mi.: </b>${POP00_SQMI:NumberFormat}<br/>" + "<b>2007 Population: </b>${POP2007:NumberFormat}<br/>" + "<b>2007 Population per Sq. Mi.: </b>${POP07_SQMI:NumberFormat}");
map.infoWindow.resize(245, 125);
}
dojo.addOnLoad(init);
</script>
</head>
<body>
<!-- use class="x-hide-display" to prevent a brief flicker of the content
-->
<div id="west" class="x-hide-display">
</div>
<div id="center" class="x-hide-display" style="z-index: 100;">
</div>
<div id="props-panel" class="x-hide-display">
</div>
<div id="south" class="x-hide-display">
This content comes from the div
</div>
<div id="north" class="x-hide-display">
<!--- note ... this starts 100 px from the top -- see the cmargins for
that -->
</div>
</body>
</html>
Hi, is anyone using ExtJS 4.x layouts with newer versions of JSAPI? ExtJS has a border layout similar to Dojo's where you use the "center" panel for the map area. I am just getting started with this and looking for a simple exampel that works. There seems to be issues about how ExtJS manipulates the DOM for that "center" panel DIV and what the underlying Dojo is doing with the map object.
David Rezn (http://blog.davidrenz.com/?p=281) had a simple example based upon JSAPI 1.3 and an old version of ExtJS. However, with the newer versions on JSAPI and ExtJS, his approach no loner seemd to work. I was wondering if anybody else was had a simple working example.
I am starting by creating a veiwport with a border layoput. The "North", "South", "East" and "West" panels are blank for simplicity. I think once I am able to get the basic problem of getting the map object properly displayed in the "center" panel, I'll be OK.
Any ideas?
Thanks,
Don