class cgxp.plugins.FeaturesGrid(config)

A plugin that adds a grid panel for displaying feature information (one feature per row).

This plugin is used to display results from query plugins such as cgxp.plugins.GetFeature and cgxp.plugins.QueryBuilder.

For the queryable Base layer the identifierAttribute can be provide by the queryLayers option in a layer config:

queryLayers: [{
    name: "buildings",
    identifierAttribute: "name"
}, {
    name: "parcels",
    identifierAttribute: "number"

Example Use

Sample code showing how to add a FeaturesGrid plugin to a gxp.Viewer:

var obs = new Ext.util.Observable();

new gxp.Viewer({
    tools: [{
        ptype: "cgxp_featuresgrid",
        id: "featuresProvider",
        csvURL: "${request.route_url('csvecho')}",
        outputTarget: "featuresgrid-container",
        themes: THEMES,
        events: EVENTS
    }, {
        ptype: "cgxp_getfeature",
        actionTarget: "center.tbar",
        toggleGroup: "maptools",
        events: EVENTS,
        themes: THEMES,
        mapserverURL: "${request.route_url('mapserverproxy')}",
        WFSTypes: ${WFSTypes | n},
        externalWFSTypes: ${externalWFSTypes | n},
        enableWMTSLayers: true

Config Options

Configuration properties.


Boolean If true, the first row of every result grid is automatically selected. Default is true.


Object Merge each layer in one tab for each given array. All layers from one array must have only identical attributes.

Exemple: concatenateTabs: {‘tab_title’: [layer1, ..., layerN]}


String The encoding to use for the exported csv file. Default is ‘UTF-8’.


String if true, export only the visible columns and in the same order as in the featureGrid. Default is false.


String The extension to use for the exported csv file. Default is ‘csv’.


Boolean Specifies if the header row has to be included in the CSV. Default is ‘False’.


String Specifies the separator character for the exported CSV docs. Default is ‘,’ (comma).


Integer The grid default column width. Default is 100.


Object A style properties object to be used to show all features on the map (optional).

Defaults to { fillColor: 'red', strokeColor: 'red' }.


Ext.util.Observable An Ext.util.Observable instance used to receive events from other plugins.

  • queryopen: sent on open query tool.
  • queryclose: sent on closequery tool.
  • querystarts: sent when the query button is pressed.
  • nolayer: sent when no layer to query.
  • queryresults(features): sent when the result is received.
  • queryinfos: sent when additional infos about the query are available.

Boolean If true, selection state are remembered across all result tabs when switching tab. Also the “select all”, “select none” and “toggle” buttons act on all tabs and not only the active tab. This also enable global result in export pdf. Default is false.


Object A style properties object to be used to show features on the map when clicking on the rows in the grid (optional).

Defaults to { fillColor: 'red', strokeColor: 'red', fillOpacity: 0.6, strokeOpacity: 1, strokeWidth: 2 }.


Integer Maximum total number of features listed in all grids. Default is 200. If this plugin is combined to plugins that provide a maxFeatures parameter, such as cgxp.plugins.QueryBuilder or cgxp.plugins.GetFeature, this value will be superseded by the value of the provided maxFeatures parameter.


String CSS style used for the queryResult message.


Integer Zoom level to use when recentering on point items (optional).


String Specifies the character to delimit strings in the exported CSV docs. Default is ‘”’ (double quote).


Bool show or hide the unqueried layers in the tabpanel, default is true.


String Template for the size and number of result label. Leave it empties (“”) to get only the number of results and not the “size” part.


Object List of internal and external themes and layers. (The same object as passed to the cgxp.plugins.LayerTree).

Table Of Contents

Previous topic


Next topic


This Page