[Users] RE Can´t create grouping store
Steve.Toutant at inspq.qc.ca
Steve.Toutant at inspq.qc.ca
Wed Dec 8 15:34:05 CET 2010
Robert, I never used it with a geoext FeatureStore but with a ext
GroupingStore, like this
The store
store = new Ext.data.GroupingStore({
reader: new Ext.data.JsonReader({fields:['semcdc', 'prevalence',
'incidence']}),
url: "extJsChart.php",
autoLoad: true,
sortInfo: {field: 'semcdc', direction: 'DESC'},
groupOnSort: true,
remoteGroup: false,
groupField: 'semcdc'
});
I think you need to add some parameters to the GroupingView.
view: new Ext.grid.GroupingView({
forceFit: true,
hideGroupedColumn: true,
enableNoGroups: true, // This one is required think!
startCollapsed: true
})
Hope this help!
Steve
Robert Buckley <robertdbuckley at yahoo.com>@geoext.org
Envoyé par : users-bounces at geoext.org
2010-12-08 08:54
A
users at geoext.org
cc
Objet
[Users] Can´t create grouping store
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20101208/aa6f0059/attachment-0001.htm
More information about the Users
mailing list