(Click to open topic with navigation)
The view element of the DataviewConfig.groovy file determines the much of the look-and-feel of the item list on the DataView page. For each column, you can specify:
Columns appear on DataView pages in the order they appear in the DataviewConfig.groovy file. If you want to re-order the columns on the DataView page, simply change the order in the DataviewConfig.groovy file.
To change the column order
nodes = """{
"sort" : {"${DV_SORT_SORT}":[{"name":"ASC"}]},
"page" : {"${DV_PAGE_NUMBER}":0, "${DV_PAGE_COUNT}":20},
"filter" : "{}",
"data" : {
"view":[
{"${DV_ID_KEY}": "name", "${DV_TITLE_KEY}": "Name", "${DV_VISIBLE_KEY}": 1, "${DV_SORTABLE_KEY}": 1, "${DV_FILTERABLE_KEY}": 1, "${DV_TYPE_KEY}": "${DV_STRING_TYPE}"},
{"${DV_ID_KEY}": "state", "${DV_TITLE_KEY}": "Status", "${DV_VISIBLE_KEY}": 1, "${DV_SORTABLE_KEY}": 1, "${DV_FILTERABLE_KEY}": 1, "${DV_TYPE_KEY}": "${DV_STRING_TYPE}", "${DV_DBKEY_KEY}": "states.state"},
{"${DV_ID_KEY}": "power", "${DV_TITLE_KEY}": "Power", "${DV_VISIBLE_KEY}": 1, "${DV_SORTABLE_KEY}": 1, "${DV_FILTERABLE_KEY}": 1, "${DV_TYPE_KEY}": "${DV_STRING_TYPE}", "${DV_DBKEY_KEY}": "states.powerState"},
{"${DV_ID_KEY}": "os", "${DV_TITLE_KEY}": "OS", "${DV_VISIBLE_KEY}": 1, "${DV_SORTABLE_KEY}": 1, "${DV_FILTERABLE_KEY}": 1, "${DV_TYPE_KEY}": "${DV_STRING_TYPE}", "${DV_DBKEY_KEY}": "operatingSystem.image", "${DV_WIDTH_KEY}": 100},
{"${DV_ID_KEY}": "totalMemory", "${DV_TITLE_KEY}": "Memory", "${DV_VISIBLE_KEY}": 1, "${DV_SORTABLE_KEY}": 1, "${DV_FILTERABLE_KEY}": 0, "${DV_TYPE_KEY}": "${DV_LONG_TYPE}", "${DV_DBKEY_KEY}": "resources.memory.configured"},
{"${DV_ID_KEY}": "totalProcessors", "${DV_TITLE_KEY}": "Procs", "${DV_VISIBLE_KEY}": 1, "${DV_SORTABLE_KEY}": 1, "${DV_FILTERABLE_KEY}": 0, "${DV_TYPE_KEY}": "${DV_LONG_TYPE}", "${DV_DBKEY_KEY}": "resources.processors.configured"},
{"${DV_ID_KEY}": "images", "${DV_TITLE_KEY}": "Images", "${DV_VISIBLE_KEY}": 0, "${DV_SORTABLE_KEY}": 0, "${DV_FILTERABLE_KEY}": 0, "${DV_TYPE_KEY}": "${DV_STRING_TYPE}"}
]}
}"""
Note the order of the columns. This is the order in which the columns will appear (left-to-right) on the Node Management page.
... "data" : { "view":[ {"${DV_ID_KEY}": "name", "${DV_TITLE_KEY}": "Name", "${DV_VISIBLE_KEY}": 1, "${DV_SORTABLE_KEY}": 1, "${DV_FILTERABLE_KEY}": 1, "${DV_TYPE_KEY}": "${DV_STRING_TYPE}"}, {"${DV_ID_KEY}": "power", "${DV_TITLE_KEY}": "Power", "${DV_VISIBLE_KEY}": 1, "${DV_SORTABLE_KEY}": 1, "${DV_FILTERABLE_KEY}": 1, "${DV_TYPE_KEY}": "${DV_STRING_TYPE}", "${DV_DBKEY_KEY}": "states.powerState"}, {"${DV_ID_KEY}": "state", "${DV_TITLE_KEY}": "Status", "${DV_VISIBLE_KEY}": 1, "${DV_SORTABLE_KEY}": 1, "${DV_FILTERABLE_KEY}": 1, "${DV_TYPE_KEY}": "${DV_STRING_TYPE}", "${DV_DBKEY_KEY}": "states.state"}, {"${DV_ID_KEY}": "os", "${DV_TITLE_KEY}": "OS", "${DV_VISIBLE_KEY}": 1, "${DV_SORTABLE_KEY}": 1, "${DV_FILTERABLE_KEY}": 1, "${DV_TYPE_KEY}": "${DV_STRING_TYPE}", "${DV_DBKEY_KEY}": "operatingSystem.image", "${DV_WIDTH_KEY}": 100}, {"${DV_ID_KEY}": "totalMemory", "${DV_TITLE_KEY}": "Memory", "${DV_VISIBLE_KEY}": 1, "${DV_SORTABLE_KEY}": 1, "${DV_FILTERABLE_KEY}": 0, "${DV_TYPE_KEY}": "${DV_LONG_TYPE}", "${DV_DBKEY_KEY}": "resources.memory.configured"}, {"${DV_ID_KEY}": "totalProcessors", "${DV_TITLE_KEY}": "Procs", "${DV_VISIBLE_KEY}": 1, "${DV_SORTABLE_KEY}": 1, "${DV_FILTERABLE_KEY}": 0, "${DV_TYPE_KEY}": "${DV_LONG_TYPE}", "${DV_DBKEY_KEY}": "resources.processors.configured"}, {"${DV_ID_KEY}": "images", "${DV_TITLE_KEY}": "Images", "${DV_VISIBLE_KEY}": 0, "${DV_SORTABLE_KEY}": 0, "${DV_FILTERABLE_KEY}": 0, "${DV_TYPE_KEY}": "${DV_STRING_TYPE}"} ]} ...
Your changes should update automatically. However, if you see that your changes have not taken effect, it is recommended that you restart Tomcat.
Columns are labeled a certain way by default in the DataviewConfig.groovy file. If you want to change the column heading label, you can modify the "${DV_TITLE_KEY}" value for the column you want to customize.
To re-label a column heading
nodes = """{
"sort" : {"${DV_SORT_SORT}":[{"name":"ASC"}]},
"page" : {"${DV_PAGE_NUMBER}":0, "${DV_PAGE_COUNT}":20},
"filter" : "{}",
"data" : {
"view":[
...
...
"data" : {
"view":[
{"${DV_ID_KEY}": "name", "${DV_TITLE_KEY}": "ID", "${DV_VISIBLE_KEY}": 1, "${DV_SORTABLE_KEY}": 1, "${DV_FILTERABLE_KEY}": 1, "${DV_TYPE_KEY}": "${DV_STRING_TYPE}"},
...
Your changes should update automatically. However, if you see that your changes have not taken effect, it is recommended that you restart Tomcat.
You can configure which columns in a DataView page are visible by modifying the "${DV_VISIBLE_KEY}" value for the column you want to hide or show. The value for this element is either 1 for true (visible) or 0 for false (hidden).
To hide or show a column
nodes = """{
"sort" : {"${DV_SORT_SORT}":[{"name":"ASC"}]},
"page" : {"${DV_PAGE_NUMBER}":0, "${DV_PAGE_COUNT}":20},
"filter" : "{}",
"data" : {
"view":[
...
...
"data" : {
"view":[
{"${DV_ID_KEY}": "name", "${DV_TITLE_KEY}": "Name", "${DV_VISIBLE_KEY}": 0, "${DV_SORTABLE_KEY}": 1, "${DV_FILTERABLE_KEY}": 1, "${DV_TYPE_KEY}": "${DV_STRING_TYPE}"},
...
Your changes should update automatically. However, if you see that your changes have not taken effect, it is recommended that you restart Tomcat.
You can configure which columns in a DataView page are sortable by modifying the "${DV_SORTABLE_KEY}" value for the column you want to customize. The value for this element is either 1 for true (sortable) or 0 for false (not sortable).
To make a column sortable
nodes = """{
"sort" : {"${DV_SORT_SORT}":[{"name":"ASC"}]},
"page" : {"${DV_PAGE_NUMBER}":0, "${DV_PAGE_COUNT}":20},
"filter" : "{}",
"data" : {
"view":[
...
...
"data" : {
"view":[
{"${DV_ID_KEY}": "name", "${DV_TITLE_KEY}": "Name", "${DV_VISIBLE_KEY}": 1, "${DV_SORTABLE_KEY}": 0, "${DV_FILTERABLE_KEY}": 1, "${DV_TYPE_KEY}": "${DV_STRING_TYPE}"},
...
Your changes should update automatically. However, if you see that your changes have not taken effect, it is recommended that you restart Tomcat.
You can configure which columns in a DataView page are filterable by modifying the "${DV_FILTERABLE_KEY}" value for the column you want to customize. The value for this element is either 1 for filterable or 0 for not filterable.
To make a column filterable
nodes = """{
"sort" : {"${DV_SORT_SORT}":[{"name":"ASC"}]},
"page" : {"${DV_PAGE_NUMBER}":0, "${DV_PAGE_COUNT}":20},
"filter" : "{}",
"data" : {
"view":[
...
...
"data" : {
"view":[
{"${DV_ID_KEY}": "name", "${DV_TITLE_KEY}": "Name", "${DV_VISIBLE_KEY}": 1, "${DV_SORTABLE_KEY}": 1, "${DV_FILTERABLE_KEY}": 0, "${DV_TYPE_KEY}": "${DV_STRING_TYPE}"},
...
Your changes should update automatically. However, if you see that your changes have not taken effect, it is recommended that you restart Tomcat.
Column widths are controlled in the DataviewConfig.groovy file. If you want to change the width for a certain column, you can modify (or add) the "${DV_WIDTH_KEY}" value for the column you want to resize.
To change a column's width
nodes = """{
"sort" : {"${DV_SORT_SORT}":[{"name":"ASC"}]},
"page" : {"${DV_PAGE_NUMBER}":0, "${DV_PAGE_COUNT}":20},
"filter" : "{}",
"data" : {
"view":[
...
...
"data" : {
"view":[
{"${DV_ID_KEY}": "name", "${DV_TITLE_KEY}": "Name", "${DV_VISIBLE_KEY}": 1, "${DV_SORTABLE_KEY}": 1, "${DV_FILTERABLE_KEY}": 1, "${DV_TYPE_KEY}": "${DV_STRING_TYPE}"}, "${DV_WIDTH_KEY}": 50},
}...
You should only modify column widths for columns you think might need to be wider. It is also recommended that you leave at least one column with the width unset so that the table can resize properly as the browser window resizes.
Your changes should update automatically. However, if you see that your changes have not taken effect, it is recommended that you restart Tomcat.
Related topics