<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt">Hi,<br><span>I have a problem with the FeatureStore. I try to make the example (<a target="_blank" href="http://dev.geoext.org/trunk/geoext/examples/feature-grid.html">http://dev.geoext.org/trunk/geoext/examples/feature-grid.html</a>) but it doesn't work.</span><br>I have the map and the grid but without the features and I don't understand why.<br><br>This is my code, it's the same as in the example, I just change the links of libraries and put the script in my HTML files. The links are ok and i have the JSON files in the data folder.<br><br><html><br> <head><br> <title>test_atlas</title><br> <br> <script
src="ext-3.1.1/adapter/ext/ext-base.js" type="text/javascript"></script><br> <script src="ext-3.1.1/ext-all.js" type="text/javascript"></script><br> <br> <script src="OpenLayers-2.8/OpenLayers.js" type="text/javascript"></script><br> <script src="OpenLayers-2.8/lib/OpenLayers/Lang/fr.js"></script><br> <br> <script type="text/javascript" src="GeoExt/script/GeoExt.js"></script><br> <br><br> <link rel="stylesheet" type="text/css" href="ext-3.1.1/resources/css/ext-all.css"></link><br> <br>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><br><br> <script type="text/javascript" ><br><br> var mapPanel, store, gridPanel, mainPanel;<br><br> Ext.onReady(function() {<br> // create map instance<br> var map = new OpenLayers.Map();<br> var wmsLayer = new OpenLayers.Layer.WMS(<br> "vmap0",<br><span> "<a target="_blank"
href="http://labs.metacarta.com/wms/vmap0">http://labs.metacarta.com/wms/vmap0</a>",</span><br> {layers: 'basic'}<br> );<br><br> // create vector layer<br> var vecLayer = new OpenLayers.Layer.Vector("vector");<br> map.addLayers([wmsLayer, vecLayer]);<br><br> // create map panel<br> mapPanel = new GeoExt.MapPanel({<br> title:
"Map",<br> region: "center",<br> height: 400,<br> width: 600,<br> map: map,<br> center: new OpenLayers.LonLat(5, 45),<br> zoom: 6<br> });<br> <br> // create feature store, binding it to the
vector layer<br> store = new GeoExt.data.FeatureStore({<br> layer: vecLayer,<br> fields: [<br> {name: 'name', type: 'string'},<br> {name: 'elevation', type: 'float'}<br> ],<br> proxy: new GeoExt.data.ProtocolProxy({<br>
protocol: new OpenLayers.Protocol.HTTP({<br> url: "data/summits.json",<br> format: new OpenLayers.Format.GeoJSON()<br> })<br> }),<br> autoLoad: true<br> });<br><br> // create grid panel
configured with feature store<br> gridPanel = new Ext.grid.GridPanel({<br> title: "Feature Grid",<br> region: "east",<br> store: store,<br> width: 320,<br> columns: [{<br> header: "Name",<br>
width: 200,<br> dataIndex: "name"<br> }, {<br> header: "Elevation",<br> width: 100,<br> dataIndex: "elevation"<br> }],<br> sm: new GeoExt.grid.FeatureSelectionModel() <br>
});<br><br> // create a panel and add the map panel and grid panel<br> // inside it<br> mainPanel = new Ext.Panel({<br> renderTo: "mainpanel",<br> layout: "border",<br> height: 400,<br> width: 920,<br> items: [mapPanel, gridPanel]<br>
});<br> });<br><br> </script><br><br> <br> </head><br> <br> <body><br> <br> <div id="mainpanel"></div><br> <br> </body><br> <br></html><br><br>And even with just a html file containing a copy of the HTML example, changing the two relative links by absolut links, it doesm't work : <br><br><html><br> <head><br><br><span> <script type="text/javascript"
src="%3Ca%20target=%27_blank%27%20href=%27http://extjs.cachefly.net/ext-2.2.1/adapter/ext/ext-base.js%27%3Ehttp://extjs.cachefly.net/ext-2.2.1/adapter/ext/ext-base.js%3C/a%3E"></script></span><br><span> <script type="text/javascript" src="%3Ca%20target=%27_blank%27%20href=%27http://extjs.cachefly.net/ext-2.2.1/ext-all.js%27%3Ehttp://extjs.cachefly.net/ext-2.2.1/ext-all.js%3C/a%3E"></script></span><br><span> <link rel="stylesheet" type="text/css" href="%3Ca%20target=%27_blank%27%20href=%27http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css%27%3Ehttp://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css%3C/a%3E"></span><br><span> <link rel="stylesheet" type="text/css"
href="%3Ca%20target=%27_blank%27%20href=%27http://extjs.cachefly.net/ext-2.2.1/examples/shared/examples.css%27%3Ehttp://extjs.cachefly.net/ext-2.2.1/examples/shared/examples.css%3C/a%3E"></span><br><br><span> <script type="text/javascript" src="%3Ca%20target=%27_blank%27%20href=%27http://www.openlayers.org/api/2.9/OpenLayers.js%27%3Ehttp://www.openlayers.org/api/2.9/OpenLayers.js%3C/a%3E"></script></span><br> <span style="font-weight: bold;"><span><script type="text/javascript" src="%3Ca%20target=%27_blank%27%20href=%27http://dev.geoext.org/trunk/geoext/lib/GeoExt.js%27%3Ehttp://dev.geoext.org/trunk/geoext/lib/GeoExt.js%3C/a%3E"></script></span></span><br> <br> <span style="font-weight: bold;"><span><script type="text/javascript"
src="%3Ca%20target=%27_blank%27%20href=%27http://dev.geoext.org/trunk/geoext/examples/feature-grid.js%27%3Ehttp://dev.geoext.org/trunk/geoext/examples/feature-grid.js%3C/a%3E"></script></span></span><br><br> </head><br> <br> <body><br> <br> <h1>Grid Panel configured with a GeoExt.data.FeatureStore</h1><br> <br> <p>This example shows an Ext grid loaded with features read from a<br> GeoJSON document (data/summits.json).</p><br> <br> <p>Because the layer and the store are bound to each other, the<br> features loaded into the store are automatically added to the layer. A
<br> GeoExt feature selection model is also used so that selecting rows in <br> the grid selects features in the layer, and vice-versa.</p> <br> <br> <p>See <a href=feature-grid.js>feature-grid.js</a>.</p><br> <br> <div id="mainpanel"></div><br> <br> </body><br><br></html><br><br><div><br>I don't see where is the error, it's may be a little one or a big one :)<br><br>Thank you for your help.<br><br>Benoit<br></div>
</div><br>
</body></html>