.. _widget-resultextgrid-label: =============== ResultExtGrid =============== This widget is used to display query results made on resources in a grid. Each column inside represents a resource field. You can either choose which one to display or display them all. The following widgets can use the ResultExtGrid widget (using the tag) : * :ref:`widget-queryonclick-label`. This widget MUST be linked to a resource. XML Sample ------------ There are 3 different ways to setup the fields to use for each resource : (1) using the resource fields and its options (recommended) (2) using the 'useResponseFields' widget option (3) using the 'grids' widget option (deprecated) (1) using the resource fields and its options (recommended) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Will use the resource fields and its options to display the columns .. code-block:: xml W_QueryOnClick W_ResultExtGrid W_ResultExtGrid false ... R_Popplace Cities DS_Popplace_WMS NAME Name 200 REG_CODE Regional code 80 (2) using the 'useResponseFields' widget option ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Will display all fields inside the query response, each column having the same width and using field names as column headers. .. code-block:: xml W_QueryOnClick W_MyResultExtGrid W_MyResultExtGrid false true (3) Using the widget 'grids' option (deprecated) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sample configuration, with only one resource (grid) defined .. code-block:: xml W_QueryOnClick W_MyResultExtGrid W_MyResultExtGrid false My resource R_MY_RESOURCE true rol_co_cla float 75 Sample configuration, with more than one resource (grid) defined .. code-block:: xml W_MyResultExtGrid false R_GMAP_PARK false GMap Parks NAME_E string 200 AREA float 150 PERIMETER float 150 YEAR_EST integer 50 R_GMAP_POPP false GMap Cities name string 200 reg_code integer 50 pop_range string 150 capital string 100 R_GMAP_PROV false GMap Provinces NAME string 150 NAME_E string 150 STATUS string 100 ISLAND_E string 150 drawWidget Sample ------------------- The widget can be drawn with the *drawWidget* function if is set to *false*. See :ref:`widget-basics-drawWidgets-label`, else it's automatically drawn in a Ext.Window. Mandatory Options ------------------- :inwindow: (Boolean) Defaults to *true*. Automatically draws the widget in a Ext.Window if set to *true*. Setting this to *false* means you must draw it manually in a Ext.Panel with the standard drawWidget method. Optional Options ------------------ :useResponseFields: (Boolean) Defaults to *false*. If set to true, the 'grids' option and resource fields are ignored. All fields contained in the query response are shown instead. :grids: Contains nodes. At least one is mandatory when using this option. This option is ignored when useResponseFields is set. It is also ignored if a resource has fields/field set. :grids/grid/resourcename: Name of the resource :grids/grid/displayname: Title that will appear at the top of the grid. Usually the same value as the layer title. :grids/grid/fields: Contains nodes. At least one is mandatory. :grids/grid/fields/field/id: Name of the field returned by the GetFeatureInfo request. :grids/grid/fields/field/label: Title of the column of the grid that will contain this field. :grids/grid/fields/field/type: Type of field. :grids/grid/fields/field/width: Width of the column of the grid. :grids/grid/delegatecontext: Must contains both *enabled* and *label* nodes if set. :grids/grid/delegatecontext/enabled: Boolean. If enabled, a DelegateContext button will appear at the top of the grid. :grids/grid/delegatecontext/label: Label on the DelegateContext button. Resource Fields ---------------- If a resource has fields/field tags set, those fields will be the ones displayed inside the grid. Here's the the field tags used by this widget : :name: (String) Mandatory. Defines the name of the field :title: (String) Optional. "name" is used if not set. Used as the column header. :options/width: (Integer) Optional. The width of the column in pixels. :options/type: (String) Optional. The type of field. Defaults to "string". Possible values are: string, integer, float. Service Type ------------- wms Widget Action -------------- read