[Users] Can´t create grouping store
Andreas Hocevar
ahocevar at opengeo.org
Wed Dec 8 16:13:59 CET 2010
Hi,
if you want a grouping store for vector features, you would have to extend an Ext.data.GroupingStore with a GeoExt.data.FeatureStoreMixin. Your mileage may vary though - at least I'm not aware of anybody having done this so far.
Regards,
Andreas.
On Dec 8, 2010, at 08:54 , Robert Buckley wrote:
> 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);
> })
> });
>
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list