|
|
The FeatureListTable widgetThe FeatureListTable is an extension of the Dojo Grid widget designed for displaying the alphanumeric attributes of features. Features are in turn the objects belonging to the VectorLayers in geomajas. In this section we will use a different LayerTree configuration, because we want to make use of the "ShowTableAction". This particular action show all features for the currently selected VectorLayer in a preconfigured FeatureListTable. This is exactly what we want. So for starters, the HTML and XML configurations of this new LayerTree: <div dojoType="geomajas.widget.LayerTree" id="featuresTree"></div> XML: <layerTree id="featuresTree">
<targetMap>mainMap</targetMap>
<toolRef>LayerVisibleTool</toolRef>
<toolRef>LayerLabeledTool</toolRef>
<toolRef>ShowTableAction</toolRef>
</layerTree>
This layertree configuration will look something like this:
The main difference between this LayerTree configuration, and the one we previously used, is the addition of the "ShowTableAction" tool. The configuration for this particular tool, can be found in the tools.xml file: <tool id="ShowTableAction">
<parameter name="tableID" value="mainTable" />
</tool>
This tool configuration contains 1 parameter: the ID of the FeatureListTable it is supposed to fill with features. So in the HTML, we expect to find a FeatureListTable widget with ID "mainTable". <div id="mainTable" dojoType="geomajas.widget.FeatureListTable"
supportEditing=false style="width: 100%; height: 100%;">
</div>
Indeed, in the HTML page we find the FeatureListTable with ID "mainTable". Note that there is an extra attribute here by the name of "supportEditing". By changing this value to true, it can be possible to adjust the values of the features' attributes, but this again is completely configurable in the VectorLayer's XML configuration. One extra footnote worthy of attention is that a FeatureListTable always needs a width and a height! Otherwise it will not display. Tip: See it online here. The layertree is a part of the AccordionContainer on the left. Just click the small + sign on the bottom-left. Then select a vector-layer, make sure it is visible, and press the grid icon to show the attributes of the visible features on the map. By default, the "South African Regions" layer is visible, so you can simply select that one, and press the grid icon. The resulting FeatureListTable should look like this:
|





