GeoPrisma logo

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 <result> tag) :

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)

(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.

<queryonclick>
  <name>W_QueryOnClick</name>
  <options>
    <results>
      <result>W_MyResultExtGrid</result>
    </results>
  </options>
</queryonclick>

<resultextgrid>
  <name>W_MyResultExtGrid</name>
  <options>
    <inwindow>false</inwindow>
    <useResponseFields>true</useResponseFields>
  </options>
</resultextgrid>

(3) Using the widget ‘grids’ option (deprecated)

Sample configuration, with only one resource (grid) defined

 <queryonclick>
   <name>W_QueryOnClick</name>
   <options>
     <results>
       <result>W_MyResultExtGrid</result>
     </results>
   </options>
 </queryonclick>

<resultextgrid>
  <name>W_MyResultExtGrid</name>
  <options>
    <inwindow>false</inwindow>
    <grids>
      <grid>
        <displayname>My resource</displayname>
        <resourcename>R_MY_RESOURCE</resourcename>
        <delegatecontext>
          <enabled>true</enabled>
          <label>My Link</label>
        </delegatecontext>
        <fields>
          <field>
            <id>rol_co_cla</id>
            <label>Class</label>
            <type>float</type>
            <width>75</width>
          </field>
        </fields>
      </grid>
    </grids>
  </options>
</resultextgrid>

Sample configuration, with more than one resource (grid) defined

<resultextgrid>
  <name>W_MyResultExtGrid</name>
  <options>
    <inwindow>false</inwindow>
    <grids>
      <grid>
        <resourcename>R_GMAP_PARK</resourcename>
        <delegatecontext>
          <enabled>false</enabled>
          <label>Link to v2</label>
        </delegatecontext>
        <displayname>GMap Parks</displayname>
        <fields>
          <field>
            <id>NAME_E</id>
            <label>Name</label>
            <type>string</type>
            <width>200</width>
          </field>
          <field>
            <id>AREA</id>
            <label>Area</label>
            <type>float</type>
            <width>150</width>
          </field>
          <field>
            <id>PERIMETER</id>
            <label>Perimeter</label>
            <type>float</type>
            <width>150</width>
          </field>
          <field>
            <id>YEAR_EST</id>
            <label>Year</label>
            <type>integer</type>
            <width>50</width>
          </field>
        </fields>
      </grid>

      <grid>
        <resourcename>R_GMAP_POPP</resourcename>
        <delegatecontext>
          <enabled>false</enabled>
          <label>Link to v2</label>
        </delegatecontext>
        <displayname>GMap Cities</displayname>
        <fields>
          <field>
            <id>name</id>
            <label>Name</label>
            <type>string</type>
            <width>200</width>
          </field>
          <field>
            <id>reg_code</id>
            <label>Reg #</label>
            <type>integer</type>
            <width>50</width>
          </field>
          <field>
            <id>pop_range</id>
            <label>Population range (code)</label>
            <type>string</type>
            <width>150</width>
          </field>
          <field>
            <id>capital</id>
            <label>Capital (code)</label>
            <type>string</type>
            <width>100</width>
          </field>

        </fields>
      </grid>

      <grid>
        <resourcename>R_GMAP_PROV</resourcename>
        <delegatecontext>
          <enabled>false</enabled>
          <label>Link to v2</label>
        </delegatecontext>
        <displayname>GMap Provinces</displayname>
        <fields>
          <field>
            <id>NAME</id>
            <label>Name</label>
            <type>string</type>
            <width>150</width>
          </field>
          <field>
            <id>NAME_E</id>
            <label>Name (2nd)</label>
            <type>string</type>
            <width>150</width>
          </field>
          <field>
            <id>STATUS</id>
            <label>Status</label>
            <type>string</type>
            <width>100</width>
          </field>
          <field>
            <id>ISLAND_E</id>
            <label>Island Name</label>
            <type>string</type>
            <width>150</width>
          </field>
        </fields>
      </grid>
    </grids>
  </options>
</resultextgrid>

drawWidget Sample

The widget can be drawn with the drawWidget function if <inwindow> is set to false. See drawWidget / drawWidgets, 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 <grid> nodes. At least one <grid> 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 <field> 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