Hi - I'm working with a map app that is using GeoExt and MapFish. In
this app you can click or draw boxes on features in the the map, and
data values for the features are then displayed in a
Ext.grid.GridPanel. It's your basic example. It uses object created
from mapfish.Protocol.MapFish.create, GeoExt.data.FeatureStore,
mapfish.widgets.data.SearchStoreMediator, and mapfish.Searcher.Map. It
also uses Ext.grid.GridPanel in a Ext.Viewport.<br>
<br>
In the initial app, which works, a feature store is created using the following method:<br>
<br>
Store = new GeoExt.data.FeatureStore({<br>
fields: [<br>
{name: 'stfid', type: 'string'},<br>
{name: 'ch_0209_r_tax_val', type: 'float'}<br>
]<br>
});<br>
<br>
However, I want to be able to change values of "name" in Store, using the method:<br>
<br>
var record = Store.getAt(0);<br>
record.set("name", "stfid");<br>
<br>
I found that I could not do this using a Store created by the above
method. However, I found the recored.set method worked if Store was
created using this method:<br>
<br>
var Record = GeoExt.data.FeatureRecord.create([<br>
{ name : "name", mapping : "name" },<br>
{ name : "type", mapping : "type" }<br>
]);<br>
<br>
var Store = new GeoExt.data.FeatureStore({<br>
fields: ['name', 'type'],<br>
});<br>
<br>
var Data = [<br>
{ name : "stfid", type : "string" },<br>
{ name : "ch_0209_r_tax_val", type : "float" }<br>
];<br>
<br>
for (var i = 0; i < Data.length; i++) {<br>
Store.add(<br>
new Record({<br>
name : Data[i].name, type : Data[i].type<br>
})<br>
);<br>
<br>
Unfortunately, now when I click on the map, no data values are
displayed in the GridPanel. The data is in firebug Console Response.
When I use the first method to create Store, I can find the values
under:<br>
<br>
Store.data.items.0.data Object feature=Object fid=25 stfid=37...<br>
ch_0209_r_tax_val 108.31<br>
<br>
However, these values do not exist when I use the second method to
create Store. How does the second method change the structure of Store
to cause this problem?<br>
<br>
Thanks<br>
Jim