![background image](http://html.mh-extra.com/html/panasonic/hmwin/hmwin_user-manual_280071314.webp)
myTable.model = model;
model
is an array of JSON elements with the table definition and data. The first element of the array will contain the
template of the rows while the other elements will contain the data to fill in the rows of the table
model[0] = row_templates;
// row templates
model[1] = row_data1;
// data of the row1
model[2] = row_data2;
// data of the row2
model[3] = row_data3;
// data of the row3
model[4] = row_data4;
// data of the row4
model[5] = row_data4;
// data of the row5
The
row templates
is a multi dimensional array where each array defines the datalink of one template row.
On the below example, we have a template for two rows.
var row_templates = {
_h : [
[ []
, []
],
//rowType = 0
[ ["text"] , ["value"] ]
//rowType = 1
]
}
The first row has two columns that do not contain data links. We use this template for the header on the first row of our
table.
The second row defines the template of one row with the “text” property of the widget into the first column and the “value”
property of the widget into the second column. They will be dynamically filled using the data provided inside the model
variable.
On the below example we define a
row of data
var row_data = {
_t : 1,
_v : ["Temperature:", { _c : "dl" , s : "_TagMgr", a : "Tag1", i: 0, m : 2 }]
}
The first element is the row template to use while the second element is the array with the data to use. In our example
“Temperature:” is the text to use inside the widget on the first column, while the other element is a datalink that will provide
the value to fill the value property of the widget into the second column.
The JSON datalink element:
Parameter
Description
_c : "dl"
Identify the JSON element as a Datalink
s : "_TagMgr"
Specify the source of data is the Tag Manager
a : "Tag1", i: 0, m:2
Specify tag name and index (necessary when the tag is an array) and the
read/write mode
312
HMWIN Studio | User Manual | v206 (2017-06-30) | EN | © 2014-2017 Panasonic Electric Works Europe AG
Table widget
Summary of Contents for HMWIN
Page 166: ...164 HMWIN Studio User Manual v206 2017 06 30 EN 2014 2017 Panasonic Electric Works Europe AG ...
Page 258: ...256 HMWIN Studio User Manual v206 2017 06 30 EN 2014 2017 Panasonic Electric Works Europe AG ...
Page 380: ...378 HMWIN Studio User Manual v206 2017 06 30 EN 2014 2017 Panasonic Electric Works Europe AG ...
Page 439: ......