...
Note |
---|
The following properties emptyMsg , displayMsg , beforePageText , afterPageText , firstText , prevText , nextText , lastText , refreshText and itemsText can all be set globally using i18n resources as of version 2.25.42 of the com.cohga.client.weave.main bundle, see examples. This bundle version also added support for the above properties in all of the data grid views, but unless they need to be customised per-window it's recommended that the global resource values be used instead since they change all the views at once. |
Examples
Code Block |
---|
| xml | xml |
---|
title | Basic grid view |
---|
linenumbers | true |
---|
| xml |
---|
|
<view id='com.cohga.html.client.main.gridView'>
<label>Identify</label>
<location>south</location>
</view>
|
Code Block |
xml |
---|
| xml |
---|
title | Formatting a grid view |
---|
linenumbers | true |
---|
| xml |
---|
|
<view id="com.cohga.html.client.main.gridView">
<label>Data</label>
<location>center.south</location>
<toolbar>
<!-- toolbar items go here -->
</toolbar>
<!-- override column widths -->
<format>
<!-- set column widths for columns in a specific data -->
<data id="ar_property_details">
<column id="PropNo" width="20"/>
<column id="OwnerName" width="200"/>
</data>
<data id="ar_road_details">
<column id="Status" width="10"/>
<column id="Old_Status" hidden="true"/>
</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"/>
<column id="oid" hidden="true"/>
</format>
</view>
|
Code Block |
xml |
---|
| xml |
---|
title | Formatting with snippet (for re-use of formatting) |
---|
linenumbers | true |
---|
| xml |
---|
|
<client:format id="custom">
<!-- set column widths for columns in a specific data -->
<data id="ar_property_details">
<column id="PropNo" width="20"/>
<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"/>
</client:format>
<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>
<!-- override formatting -->
<format ref="custom"/>
</view>
</perspective>
</client:config>
|
Setting formatting in defaults section
Code Block |
xml |
---|
| xml |
---|
title | Alternate default formatting of grid and align option as of version 2.4.14 |
---|
linenumbers | true |
---|
| xml |
---|
|
<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 |
xml |
---|
| xml |
---|
title | Localising the grid, old format |
---|
linenumbers | true |
---|
| xml |
---|
|
<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 |
xml |
---|
| xml |
---|
title | Localising the grid, new format |
---|
linenumbers | true |
---|
| xml |
---|
|
<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>
|
...
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 |
---|
|
<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>
|
...
Displaying record count
Code Block |
xml |
---|
|
<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>
|
...