Provides a means of displaying attribute information relating to the currently selected entities.
ID
com.cohga.html.client.main.gridView
Sub-tags
...
name
...
type
...
cardinality
...
default
...
description
...
label
Provides a means of displaying attribute information relating to the currently selected entities.
ID
com.cohga.html.client.main.gridView
Sub-tags
name | type | cardinality | default | description |
---|---|---|---|---|
label | String | 0..1 |
Label to display in tab | ||
location | String | 1..1 |
Which region to add the view to | ||
toolbar | grid actions | 0..n |
A collection of tools to add to the panel | ||
format | format definitions | 0..1 |
A collection of formatting options |
autoShowOnUpdate |
boolean | 0..1 |
"No data to display"
Text to display for no results
displayMsg
string
0..1
"Displaying {0} - {1} of {2}"
Paging toolbar text
beforePageText
string
0..1
"Page"
Label before page number
afterPageText
string
0..1
"of {0}"
Text after page number
firstText
string
0..1
"First Page"
Tooltip for first page button
prevText
string
0..1
"Previous Page"
Tooltip for previous page button
nextText
string
0..1
"Next Page"
Tooptip for next page button
lastText
string
0..1
"Last Page"
Tooltip for last page button
refreshText
string
0..1
"Refresh"
Tooltip for refresh button
itemsText
string
0..1
"Items per page"
Text for items per page
Example
Basic grid view
...
<view id='com.cohga.html.client.main.gridView'>
<label>Identify</label>
<location>south</location>
</view>
Formatting a grid view
...
false | Should the grid panel tab be set active to active when the selection or active entity changes? Requires at least version 3.92.x of com.cohga.client.weave.main, which was first included in Weave 2.5.29. Note this defaults to |
Note |
---|
See Common grid panel configuration options for other grid related options |
Positioning Highlight Markers
When you click on a row in the data grid the map will highlight the geometry related to the selected row. Normally the highlighting geometry is determined by the geometry associated with the entity that the row corresponds to, but it's also possible to include a coordinate within the data definition that the data grid is displaying and have a marker placed at that coordinate instead.
For example, a land parcel entity would generally be represented as a polygon boundary. But if you have water meter records associated with a parcel you could include a coordinate in the water meter data definition so that when a user clicks on a row in the data grid a marker is placed at the location of the water meter on the property rather than having the property boundary highlighted.
To replace the default highlight geometry with a marker in this way you should include a numeric x
and y
(lower case) parameters in your data definition, which contains the coordinate for the point. You can also include a crs
parameter that provides the EPSG code for the projection that the coordinate is stored in; the coordinates will be assumed to be in the same coordinate system as the underlying map if this is not included. Note that you can also use latitude
and longitude
or lat
and lon
as the field names, and in his case, if the crs
parameter isn't included it's assumed to be WGS84
. It's suggested that a crs
parameter always be included to explicitly provide the CRS and so allowing the same data definition to be used regardless of what CRS is used in the underlying map.
Code Block | ||||
---|---|---|---|---|
| ||||
<data:datadefinition id="water_meter"> <datasourcedataconnection datasource="db1" table="WATER_METER" key="COMPKEY"> <parameter column="COMPKEY" /> <toolbar> <parameter column="CATEGORY" /> <!-- toolbar items go here --<parameter column="TYPE" /> </toolbar> <!-- override column widths --<parameter column="OTHER" /> <format> <parameter name="x" label="X" column="LOCATION_X" type="float" /> <!-- set column widths for columns in a specific data --<parameter name="y" label="Y" column="LOCATION_Y" type="float" /> <parameter <data id="ar_property_details"name="crs" label="CRS" column="'EPSG:28355'" /> </datasourcedataconnection> </data:datadefinition> <column <data:data id="PropNowater_meter" widthdatadefinition="20water_meter"/> <column id="OwnerName" width="200"/> </data> <data id="ar_road_details"> <column id="Status" width="10"/ entity="water_meter" label="Water Meter"/> |
On a final note, it's possible to hide the additional parameters by setting hidden
to true
when formatting the columns, as described in the examples below.
Warning |
---|
There was a bug, fixed in 2.5.22.1, that caused the marker not to be displayed if the |
Examples
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<view id='com.cohga.html.client.main.gridView'> <label>Identify</label> <location>south</location> <column id="Old_Status" hidden="true"/></view> |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<view id="com.cohga.html.client.main.gridView"> <label>Data</label> <<location>center.south</data>location> <toolbar> <!-- settoolbar columnitems widthgo globallyhere for--> columns in any data --> </toolbar> <!-- override column <column id="RoadName" width="200"/>widths --> <format> <column id="RoadType" width="50"/> <!-- set column widths for columns in a specific <column id="Suburb" width="250"/data --> <column<data id="oid" hidden="true"/>ar_property_details"> </format> </view> |
Formatting with snippet (for re-use of formatting)
Code Block | |
---|---|
xml | xml |
linenumbers | true | <client:format id="custom" <column id="PropNo" width="20"/> <!-- set column widths for columns in a specific data --> <data id="ar_property_details"> <column id="PropNoOwnerName" width="20200"/> <column id="OwnerName" width="200"/></data> </data> <data id="ar_road_details"> <column id= <column id="Status" width="10"/> </data> <!-- set column width globally for columns in any data --> <column id="RoadNameOld_Status" widthhidden="200true"/> <column id="RoadType" width="50"/> </data> <column id="Suburb" width="250"/> </client:format> <client:config id="test"> <!-- there should be other config items hereset column width globally for columns in any data --> <view <column id="com.cohga.html.client.main.gridView"RoadName" width="200"/> <label>Data</label> <column id="RoadType" width="50"/> <location>center.south</location> <column id="Suburb" width="250"/> <toolbar> <column id="oid" hidden="true"/> </format> </view> |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<client:format id="custom"> <!-- toolbar items go here <!--> set column widths for columns in a specific data --> </toolbar> <data id="ar_property_details"> <!-- override formatting --<column id="PropNo" width="20"/> <format ref<column id="OwnerName" width="custom200"/> </view> </client:config> |
Localising the grid view
Code Block | |
---|---|
xml | xml |
linenumbers | true | <client:configdata> <data id="examplear_road_details"> <!-- there should be other config items here --> <column id="Status" width="10"/> <view id="com.cohga.html.client.main.gridView"> </data> <!-- set column width globally for columns in <label>Data</label>any data --> <column <location>center.south</location>id="RoadName" width="200"/> <column id="RoadType" width="50"/> <emptyText>%nodata.text</emptyText> <column id="Suburb" width="250"/> </client:format> </view> <client:config id="test"> <!-- there shouldwould be other config items here --> <client:config> <client:resources lang="ru"> <perspective> <resource id="nodata.text">Нет данных для отображения</resource> </client:resources> <client:resources lang="sv"> <resource id="nodata.text">Inga data för att visa</resource> </client:resources> <client:resources lang="it"> <!-- there would be other config items here --> <view id="com.cohga.html.client.main.gridView"> <resource id="nodata.text">Nessun dato da visualizzare</resource> </client:resources> |
Date and Time formatting
You can also change the default date, time and date/time format by setting adding dateformat, timeformat and/or datetimeformat entries to the <data> section of the <defaults> section in the client config.
Code Block | |
---|---|
xml | xml |
linenumbers | true | <client:config id="test"> <label>Data</label> ... <defaults> <location>center.south</location> ... <data> <toolbar> <dateformat>Y-m-d</dateformat> <!-- toolbar items go here --> <timeformat>H:i:s</timeformat> </toolbar> <datetimeformat>Y-m-d H:i:s</datetimeformat> <!-- </data>override formatting --> <format ref="custom"/> </view> ... </defaults> </client:config> |
Place-holders
...
name
...
value
...
format
...
d
...
</perspective>
</client:config>
|
Setting formatting in defaults section
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<client:config id="test">
<!-- there would be other config items here -->
<perspective>
<!-- there would be other config items here -->
<view id="com.cohga.html.client.main.gridView">
<label>Data</label>
<location>center.south</location>
<toolbar>
<!-- toolbar items go here -->
</toolbar>
</view>
</perspective>
<defaults>
<data>
<!-- set column widths for columns in a specific data -->
<data id="ar_property_details">
<column id="PropNo" width="20" align="right"/>
<column id="OwnerName" width="200"/>
</data>
<data id="ar_road_details">
<column id="Status" width="10"/>
</data>
<!-- set column width globally for columns in any data -->
<column id="RoadName" width="200"/>
<column id="RoadType" width="50"/>
<column id="Suburb" width="250"/>
</data>
</defaults>
</client:config>
|
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<client:config id="example">
<!-- there should be other config items here -->
<view id="com.cohga.html.client.main.gridView">
<label>Data</label>
<location>center.south</location>
<emptyMsg>%nodata.text</emptyMsg>
</view>
<!-- there should be other config items here -->
<client:config>
<client:resources>
<resource id="nodata.text">No data to display</resource>
</client:resources>
<client:resources lang="ru">
<resource id="nodata.text">Нет данных для отображения</resource>
</client:resources>
<client:resources lang="sv">
<resource id="nodata.text">Inga data för att visa</resource>
</client:resources>
<client:resources lang="it">
<resource id="nodata.text">Nessun dato da visualizzare</resource>
</client:resources>
|
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<client:config id="example">
<!-- there should be other config items here -->
<view id="com.cohga.html.client.main.gridView">
<label>Data</label>
<location>center.south</location>
<!-- note, no text properties specified here -->
</view>
<!-- there should be other config items here -->
<client:config>
<client:resources>
<resource id="grid.data.emptyMsg">No data to display</resource>
</client:resources>
<client:resources lang="ru">
<resource id="grid.data.emptyMsg">Нет данных для отображения</resource>
</client:resources>
<client:resources lang="sv">
<resource id="grid.data.emptyMsg">Inga data för att visa</resource>
</client:resources>
<client:resources lang="it">
<resource id="grid.data.emptyMsg">Nessun dato da visualizzare</resource>
</client:resources>
|
I18n resources
id | default |
---|---|
grid.data.emptyMsg | No data to display |
grid.page.displayMsg | Displaying {0} - {1} of {2} |
grid.page.beforePage | Page |
grid.page.afterPage | of {0} |
grid.page.first | First Page |
grid.page.prev | Previous Page |
grid.page.next | Next Page |
grid.page.last | Last Page |
grid.page.refresh | Refresh |
grid.page.items | Items per page |
Date and Time formatting
You can also change the default date, time and date/time format by setting adding dateformat, timeformat and/or datetimeformat entries to the <data> section of the <defaults> section in the client config.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<client:config id="test">
...
<defaults>
...
<data>
<dateformat>Y-m-d</dateformat>
<timeformat>H:i:s</timeformat>
<datetimeformat>Y-m-d H:i:s</datetimeformat>
</data>
...
</defaults>
</client:config>
|
Place-holders
name | value | format |
d | Day of Month | Numeric, 2 digits, left padded |
D | Day of Week | Text, long |
j | Day of Month | Numeric |
l | Day of Week | Text, short |
N | Day of Week | Numeric, 1=Monday, 7=Sunday |
S | Day of Month Suffix | Text, 'st', 'nd', 'rd', 'th' |
w | Day of Week | Numeric, 0=Sunday, 6=Saturday |
z | Day of Year | Numeric |
W | Week of Year | Numeric, 2 digits, left padded |
F | Month | Text, long |
m | Month | Numeric, 2 digits, left padded |
D
Day of Week
Text, long
j
Day of Month
Numeric
l
Day of Week
Text, short
N
Day of Week
Numeric, 1=Monday, 7=Sunday
S
Day of Month Suffix
Text, 'st', 'nd', 'rd', 'th'
w
Day of Week
Numeric, 0=Sunday, 6=Saturday
z
Day of Year
Numeric
W
, January=01 | ||
M | Month | Text, short |
n | Month | Numeric, January=1 |
t | Days in Month | Numeric |
Y | Year | Numeric, 4 digits |
y | Year | Numeric, 2 digits |
a | am/pm | Text |
A | AM/PM | Text |
g | Hour | 12 Hour, Numeric |
G | Hour | 24 Hour, Numeric |
h | Hour | 12 Hour, 2 digits, left padded |
H | Hour | 24 Hour, 2 digits, left padded |
i | Minute | Numeric, 2 digits, left padded |
s |
Month
Text, long
m
Second | Numeric, 2 digits, left padded | |
u | Milli-Second | Numeric, |
3 digits, left padded |
M
Month
Text, short
n
Month
Numeric, January=1
t
Days in Month
Numeric
Y
Year
Numeric, 4 digits
y
Year
Numeric, 2 digits
a
am/pm
Text
A
AM/PM
Text
g
Hour
12 Hour, Numeric
G
Hour
24 Hour, Numeric
h
Hour
12 Hour, 2 digits, left padded
H
Hour
24 Hour, 2 digits, left padded
i
Minute
Numeric, 2 digits, left padded
s
Second
Numeric, 2 digits, left padded
u
Milli-Second
Numeric, 3 digits, left padded
T
Timezone
T | Timezone | String |
Displaying record count
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<client:config id="example">
<!-- there should be other config items here -->
<view id="com.cohga.html.client.main.gridView">
<label>Data</label>
<location>center.south</location>
<displayMsg>Displaying {0} - {1} of {2}</displayMsg>
</view>
<!-- there should be other config items here -->
<client:config>
|