[Users] Can´t create grouping store

Robert Buckley robertdbuckley at yahoo.com
Wed Dec 8 14:54:49 CET 2010


Hi,

I am trying to create a grouping store for a grid reading data from a shapefile.
Reading from a tutorial it should be easy to adapt the grid by entering the 
following configs...


sortInfo and groupField...to the store

and 

view to the grid


however I get the error..."this.grid.store.getGroupState is not a function"

Any help would be most appreciated. I am looking to provide a grid which groups 
and creates a summary of one of the integer fields...any help would be great.

yours,

Robert Buckley

code for the store is here..

var wea_store = new GeoExt.data.FeatureStore({
        fields: [{
            name: "Bez",
            type: "string"
        }, {
            name: "Standort",
            type: "string"
        }, {
            name: "Betreiber",
            type: "string"
        }],
        sortInfo: {field: 'Standort',direction: "ASC"},
        groupField: 'Standort',
        layer: layer_wea
    });    


here is the code for the grid...
var wea_attribgridPanel = new Ext.grid.GridPanel({
        title: "Tabelle",
        view: new Ext.grid.GroupingView(),
        region: "center",
        autoWidth : true,
        stripeRows: true,
        height: 350,
        viewConfig: {
        forceFit: true
        },
        store: wea_store,
        sm: new GeoExt.grid.FeatureSelectionModel(),
        cm: new Ext.grid.ColumnModel({
            defaults: {
                sortable: true
            },
            columns: [{
                header: "Bez",
                dataIndex: "Bez",
                width: 25
            }, {
                header: "Standort",
                dataIndex: "Standort"
            }, {
                header: "Betreiber",
                dataIndex: "Betreiber",
                width: 135
            }]
        }),
        bbar: [{
            text: "an Auswahl heranzoomen",
            handler: function(){
                wea_attribgridPanel.getSelectionModel().each(function(rec){
                    var feature = rec.get("feature");
                    wea_mapPanel.map.zoomToExtent(feature.geometry.getBounds());
                })
            }
        },toolbarItems]
    });
    // 2 x Click in grid
    wea_attribgridPanel.on('rowdblclick', function(){
        wea_attribgridPanel.getSelectionModel().each(function(rec){
            var feature = rec.get("feature");
            
wea_mapPanel.map.setCenter(feature.geometry.getBounds().getCenterLonLat(), 15);
        })
    });

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20101208/5df2246d/attachment.htm 


More information about the Users mailing list