How to Add a Column to a Data Grid
When you have attributes being displayed in a Data Grid you can add or remove any field/column of the data at any time. This requires you to change the relevant Data Definition.
Step-by-step guide
Make note of the Active Layer and the field from that layer you want to add to the existing Data Grid. If you have more than one report used in the Data Grid for that Active Layer, then also note the name of the report.
- Open your
entity.xml
file. Search for the name of the Active Layer you identified above (it will appear as thelabel
). Note the value of the id XML Attribute.
Open your
data.xml
file for editing. Search for the value of theid
identified in the step above. Find the section that defines the Data Definition you want to modify.
Add a new line to the
datasourcedataconnection
section so you have a newparameter
line. The easiest way to do this is to copy and paste an existing line and then modify it. Ensure that you update thetype, name, label
andcolumn
parameters to match those of the field you are adding to the Data Definition.
In the example below the field being added is calledamd_num
and is specified as:<parameter type='string' name='zoneamendmt_num' label='Amendment Number' column='amd_num'/>
Once incorporated into the existing Data Definition it it will look like:<data:datadefinition id='dd_zone'> <datasourcedataconnection key='ogc_fid' table='mann.zones' datasource='gis'> <parameter type='integer' name='ogc_fid' label='FID' column='ogc_fid'/> <parameter type='string' name='zone_code' label='Zone Code' column='zone_code'/> <parameter type='integer' name='zone_num' label='Zone Number' column='zone_num'/> <parameter type='string' name='zoneamendmt_num' label='Amendment Number' column='amd_num'/> <parameter type='url' name='details' label='Link to more details' column='details'/> <parameter type='url' name='schedule' label='Link to schedule' column='schedule'/> </datasourcedataconnection> </data:datadefinition>
- Once this change has been made, you may need to refresh your browser to see this attribute appear in your Data Grid window.
Also refer to the following sections of the Weave System Administrator Guides:
Related articles