gxp.plugins.FeatureGrid¶
-
class
gxp.plugins.FeatureGrid(config)¶ Plugin for displaying vector features in a grid. Requires a
gxp.plugins.FeatureManager. Also provides a context menu for the grid.
Config Options¶
Configuration properties in addition to those listed for Ext.util.Observable.
-
actions ArrayCustom actions for tools that do not provide their own. Array elements are expected to be valid Ext config objects or strings referencing a valid Ext component. Actions provided here may have additionalmenuTextandbuttonTextproperties. The former will be used as text when the action is used in a menu. The latter will be conditionally used on buttons, only ifshowButtonTextis set to true. The nativetextproperty will unconditionally be used for buttons. Optional, only needed to create custom actions.
-
actionTarget ObjectorStringorArrayWhere to place the tool’s actions (e.g. buttons or menus)?In case of a string, this can be any string that references an
Ext.Containerproperty on the portal, or a unique id configured on a component.In case of an object, the object has a “target” and an “index” property, so that the tool can be inserted at a specified index in the target.
actionTarget can also be an array of strings or objects, if the action is to be put in more than one place (e.g. a button and a context menu item).
To reference one of the toolbars of an
Ext.Panel, ”.tbar”, ”.bbar” or ”.fbar” has to be appended. The default is “map.tbar”. The viewer’s main MapPanel can always be accessed with “map” as actionTarget. Set to null if no actions should be created.Some tools provide a context menu. To reference this context menu as actionTarget for other tools, configure an id in the tool’s outputConfig, and use the id with ”.contextMenu” appended. In the snippet below, a layer tree is created, with a “Remove layer” action as button on the tree’s top toolbar, and as menu item in its context menu:
{ xtype: "gxp_layertree", outputConfig: { id: "tree", tbar: [] } }, { xtype: "gxp_removelayer", actionTarget: ["tree.tbar", "tree.contextMenu"] }
If a tool has both actions and output, and you want to force it to immediately output to a container, set actionTarget to null. If you want to hide the actions, set actionTarget to false. In this case, you should configure a defaultAction to make sure that an action is active.
-
alwaysDisplayOnMap BooleanIf set to true, the features that are shown in the grid will always be displayed on the map, and there will be no “Display on map” button in the toolbar. Default is false. If set to true, no “Display on map” button will be shown.
-
autoActivate BooleanSet to false if the tool should be initialized without activating it. Default is true.
-
autoCollapse BooleanIf set to true, and when this tool’s output is added to a container that can be collapsed, it will be collapsed when no features are to be displayed. Default is false.
-
autoExpand BooleanIf set to true, and when this tool’s output is added to a container that can be expanded, it will be expanded when features are loaded. Default is false.
-
autoLoadFeature BooleanShould this tool load a feature on click? If set to true, and if there is no loaded feature at the click position, this tool will call loadFeatures on thefeatureManager, with aFeatureIdfilter created from the id of a feature returned from a WMS GetFeatureInfo request at the click position. This feature will then be selected immediately. Default is false.
-
controlOptions ObjectOptions for theOpenLayers.Control.SelectFeatureused with this tool.
-
defaultAction NumberOptional index of an action that should be active by default. Only works for actions that are aGeoExt.Actioninstance.
-
displayFeatureText StringText for feature display button (i18n).
-
displayMode StringShould we display all features on the map, or only the ones that are currently selected on the grid. Valid values are “all” and “selected”. Default is “all”.
-
featureManager StringThe id of thegxp.plugins.FeatureManagerto use with this tool.
-
lastPageTip StringTooltip string for last page action (i18n).
-
nextPageTip StringTooltip string for next page action (i18n).
-
outputAction NumberTheactionsarray index of the action that should trigger this tool’s output. Only valid ifactionsis configured. Leave this unconfigured if none of theactionsshould trigger this tool’s output.
-
outputConfig ObjectOptional configuration for the output container. This may be useful to override the xtype (e.g. “window” instead of “gx_popup”), or to provide layout configurations when rendering to anoutputTarget.
-
outputTarget StringWhere to add the tool’s output container? This can be any string that references anExt.Containerproperty on the portal, or “map” to access the viewer’s main map. If not provided, a window will be created. To reference one of the toolbars of anExt.Panel, ”.tbar”, ”.bbar” or ”.fbar” has to be appended.
-
previousPageTip StringTooltip string for previous page action (i18n).
-
selectOnMap BooleanIf set to true, features can not only be selected on the grid, but also on the map, and multi-selection will be enabled. Only set to true when no feature editor or feature info tool is used with the underlying feature manager. Default is false.
-
showButtonText Show the
buttonTextan action is configured with, if used as a button. Default is false.
-
showTotalResults BooleanIf set to true, the total number of records will be shown in the bottom toolbar of the grid, if available.
-
toggleGroup StringIf this tool should be radio-button style toggled with other tools, this string is to identify the toggle group.
-
tolerance NumberOptional pixel tolerance to use when selecting features. By default, the server decides whether a pixel click intersects a feature based on its own rules. If a pixel tolerance is provided, it will be included in requests for features to inform the server to look in a buffer around features.
-
totalMsg StringString template for showing total number of records (i18n).
-
zoomFirstPageTip StringTooltip string for first page action (i18n).
-
zoomPageExtentTip StringTooltip string for zoom to page extent action (i18n).
Public Properties¶
Public properties in addition to those listed for Ext.util.Observable.
-
FeatureGrid.active¶ BooleanIs the tool currently active?
Public Methods¶
Public methods in addition to those listed for Ext.util.Observable.
-
FeatureGrid.activate()¶ Returns: Booleantrue when this tool was activatedActivates this tool.
-
FeatureGrid.addActions()¶ Parameters: actions – ArrayOptional actions to add. If not provided, this.actions will be added.Returns: ArrayThe actions added.
-
FeatureGrid.addOutput()¶
-
FeatureGrid.deactivate()¶ Returns: Booleantrue when this tool was deactivatedDeactivates this tool.
-
FeatureGrid.getState()¶ :return {Object} Gets the configured tool state. Overwrite in subclasses to return anything other than a copy of the initialConfig property.
-
FeatureGrid.removeOutput()¶ Removes all output created by this tool
-
FeatureGrid.select()¶ Parameters: feature – OpenLayers.Feature.VectorAction to perform when a feature is selected. The default action is to unselect existing selections and select the feature using the built-in SelectFeature control. To be overridden by subclasses.
Events¶
Events in addition to those listed for Ext.util.Observable.
-
activate Fired when the tool is activated.
Listener arguments: * tool -
gxp.plugins.Toolthe activated tool
-
deactivate Fired when the tool is deactivated.
Listener arguments: * tool -
gxp.plugins.Toolthe deactivated tool