[Users] Sorting with a reconfigured Grid

Sascha Müller s.mueller76 at arcor.de
Mon Feb 8 15:26:31 CET 2010


Hi all,

I use a Grid (see below) to show attributes from wfs-Layers. The grid is 
reconfigured everytime after a new Layer is chosen.

var gridPanel = new Ext.grid.GridPanel({
           id: 'fg',
           title: "Attribute",
           region: "south",
           stripeRows: true,
           height: 200,
           split: false,
           collapsible: true,
           collapsed: true,
           sortable: false,
           store: dummyFeatureStore,
           columns: [],
           loadMask: {
             msg: "Attribute werden geladen ...",
             store: dummyFeatureStore
           },
           sm: new GeoExt.grid.FeatureSelectionModel({
             layer: wfsStoreLayer
           })
});

I reconfigure the Grid this way:

featureStore = new GeoExt.data.FeatureStore({
     layer: wfsStoreLayer,
     proxy: new GeoExt.data.ProtocolProxy({
         remoteSort: true,
         protocol: new OpenLayers.Protocol.WFS({
             url: geoserverURL + wfsURL,
             featureType: theLayer,
             featureNS: "http://www.vbl.ch",
             featurePrefix: "VBL",
             srsName: "EPSG:21781",
             version: "1.1.0"
         })
     })
});
featureStore.reader = new GeoExt.data.FeatureReader({}, recordize(fields));
gridPanel.reconfigure(featureStore, new 
Ext.grid.ColumnModel(columnize(fields)) );

...

function reloadFeatureStore() {
     featureStore.load({
         callback: function(response){
               wfsStoreLayer.setVisibility(true);
         },
     scope: this
     });
}

This works fine, but now the sorting doesn't work. I'm not sure where I 
have to look for.
Is it generally possible if the data is coming from the Server 
(GeoServer)? I use GeoExt 0.6.
How about paging? Is there something the sorting and paging have in common?

Thanks for any Idea.

Sascha


More information about the Users mailing list