Created
June 13, 2013 14:27
-
-
Save bartvde/5774101 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.ns('gxp.plugins'); | |
gxp.plugins.MFGrid = Ext.extend(gxp.plugins.Tool, { | |
ptype: "gxp_mfgrid", | |
init: function(target) { | |
this.outputAction = 0; | |
this.createStore(); | |
this.outputConfig = {width: 350, height: 300}; | |
gxp.plugins.MFGrid.superclass.init.apply(this, arguments); | |
}, | |
createStore: function() { | |
this.store = new GeoExt.data.FeatureStore({ | |
fields: [ | |
{name: 'geometry'}, | |
{name: 'name', type: 'string'}, | |
{name: 'type', type: 'string'} | |
], | |
proxy: new GeoExt.data.ProtocolProxy({ | |
protocol: new OpenLayers.Protocol.HTTP({ | |
url: "http://demo.mapfish.org/mapfishsample/2.2/wsgi/pois", | |
format: new OpenLayers.Format.GeoJSON() | |
}) | |
}), | |
autoLoad: true | |
}); | |
}, | |
addActions: function() { | |
return gxp.plugins.MFGrid.superclass.addActions.apply(this, [{text: 'Show grid'}]); | |
}, | |
addOutput: function() { | |
return gxp.plugins.MFGrid.superclass.addOutput.call(this, { | |
xtype: "gxp_featuregrid", | |
title: "Feature Attributes", | |
store: this.store, | |
ignoreFields: ["geometry"], | |
map: this.target.mapPanel.map, | |
height: 300, | |
width: 350 | |
}); | |
} | |
}); | |
Ext.preg(gxp.plugins.MFGrid.prototype.ptype, gxp.plugins.MFGrid); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment