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

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

  2. Open your entity.xml file. Search for the name of the Active Layer you identified above (it will appear as the label). Note the value of the id XML Attribute.
     
  3. Open your data.xml file for editing. Search for the value of the id identified in the step above. Find the section that defines the Data Definition you want to modify. 
     

  4. Add a new line to the datasourcedataconnection section so you have a new parameter line. The easiest way to do this is to copy and paste an existing line and then modify it. Ensure that you update the type, name, label and column parameters to match those of the field you are adding to the Data Definition.

    In the example below the field being added is called amd_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>
  5. 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: