[Users] Dynamic fields in FeatureStore
gbrun
gbrun at myopera.com
Tue Jul 26 09:42:10 CEST 2011
I found something interesting to fetch attributes names dynamically. I
would like to use an AttributesStore. So I tried to use it first in a
quite simple way but I think, I'm missing an important configuration
stuff. Here is my code:
var attributeStore = new GeoExt.data.AttributeStore({
url:
'http://192.168.168.199:81/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&typename=wfs:unit_pay'
});
var gridattributes = new Ext.grid.GridPanel({
title: "Feature Attributes",
store: attributeStore,
cm: new Ext.grid.ColumnModel([
{id: "name", header: "Name", dataIndex: "name", sortable: true},
{id: "type", header: "Type", dataIndex: "type", sortable: true}
]),
sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
autoExpandColumn: "name",
stripeRows: true,
renderTo: document.body,
height: 300,
width: 350
});
In fact, no DescribeFeatureType request is launched watching in FireBug. I
tested the DescribeFeatureType request directly trough OpenLayers and it
works (using a code I found in an old email from the OpenLayers
mailing-list).
So there really is something that I don't understand with the
AttributesStore configuration!
Could anyone help me please?
Geoffrey
On Mon, 25 Jul 2011 16:14:55 +0200, gbrun <gbrun at myopera.com> wrote:
> Hi!
>
> I found a talk about dynamic fields displayed in FeatureStore and
> GridPanel from last summer :
> http://www.mail-archive.com/users@geoext.org/msg00341.html
>
> I want to do exactly the same thing. I have a lot of WFS layers and I
> want
> to display their attributes data dynamically. So, I found a function
> allowing to reconfigure the store each time I need. But now, I need to
> find a method allowing to request each field provided by my WFS layer,
> and
> then apply it to the related store.
>
> featureStore = new GeoExt.data.FeatureStore({
> layer: currentLayer,
> fields: the future dynamic fields
> });
>
> The "currentLayer" always comes from a DescribeFeatureType request. So I
> can use dynamically some predefined fields like "fid", "state" and
> "feature". Does anyone have an idea how is it possible to extend default
> fields?
>
> Geoffrey
>
>
--
Using Opera's revolutionary email client: http://www.opera.com/mail/
More information about the Users
mailing list