[Users] WFS feature attributes do not show up in gridPanel

Bart van den Eijnden (OSGIS) bartvde at osgis.nl
Tue Jun 8 16:21:26 CEST 2010


Frans,

I think you need to specify fields in the store definition.

GisArts.storeFields = {};
GisArts.storeFields['adres_zoeken'] =
[
    'num_woonplaats',
    'num_huisnummer',
    'huisnummers',
    'num_openbare_ruimte',
    'num_huisletter',
    'num_postcode'
];

    {xtype: 'grid', autoWidth: true, autoHeight: true, title: 'Adres',
autoScroll: true, id: 'grid_Adres_zoeken',
        store: new GeoExt.data.FeatureStore({
            features: [],
            fields: GisArts.storeFields['Adres_zoeken']
        }), stripeRows: true,
        colModel: GisArts.colModel['Adres_zoeken']
    }

Best regards,
Bart

> Hello everybody,
>
> Like some others, I am trying to recreate the 'WFS features in a
> gridPanel' example that is described at
> http://workshops.opengeo.org/geoext/wfs/index.html#geoext-wfs. It seems
> I've almost got it working. The grid panel shows the right number of
> records and the FID of each record. Also the map and the grid panel are
> coupled; when I select a feature in one it is selected in the other. But
> I can't get the ofeature attributes (other than FID) to display in the
> gridPanel. Here is my store FatureStore and GridPanel definitions:
>
>      var store = new GeoExt.data.FeatureStore(
>          {
>              layer: wfs_no_gn
>          }
>      );
>      var gridPanel = new Ext.grid.GridPanel(
>          {
>              title: "Features"
>              ,height: 140
>              ,region: "south"
>              ,viewConfig: {forceFit: true}
>              ,collapsible: true
>              ,collapseMode: "mini"
>              ,store: store
>              ,sm: new GeoExt.grid.FeatureSelectionModel()
>              ,cm: new Ext.grid.ColumnModel(
>                  {
>                      defaults: {
>                          sortable: true
>                      }
>                      ,columns: [
>                          {header: "ID", dataIndex: "fid"}
>                          ,{header: "Name", dataIndex:
> "feature.attributes.text"}
>                          ,{header: "Language", dataIndex:
> "feature.attributes.language"}
>                          ,{header: "Status", dataIndex:
> "feature.attributes.nameStatus"}
>                          ,{header: "Nativeness", dataIndex:
> "feature.attributes.nativeness"}
>                      ]
>                  }
>              )
>          }
>      );
>
> It seems I am missing an important bit of insight. Should I change
> something in the data store? Or am I using a wrong dataIndex? I hope
> someone can point me in the right direction.
>
> Thanks in advance,
> Frans
>
>
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>




More information about the Users mailing list