system.secsgem.toTreeDataset
This function is used in Python Scripting.
Descriptionβ
Changes an existing dataset, as returned by the system.secsgem.toDataSet function, to make it usable for the Tree View component.
Client Permission Restrictionsβ
This scripting function has no Client Permission restrictions.
Syntaxβ
system.secsgem.toTreeDataset(dataset)
Parametersβ
| Type | Parameter | Description |
|---|---|---|
| Dataset | dataset | A DataSet containing a SECS message. Note that this parameter cannot take a JSON message, so the object returned by system.secsgem.getResponse must first be processed by system.secsgem.toDataSet. |
Returnsβ
Dataset - A dataset containing a SECS message with the following columns, as suited for Vision's tree view component: "path", "text", "icon", "background", "foreground", "tooltip", "border", "selectedText", "selectedIcon", "selectedBackground", "selectedForeground", "selectedTooltip", "selectedBorder"
Scopeβ
Gateway, Vision Client, Perspective Session
Code Exampleβ
Code Snippet
# Assuming the variable named "message" contains a SECS message, we will first convert it to a Dataset.
dataset = system.secsgem.toDataset(message)
# The initial dataset generated by toDataSet will not work with the Tree View component, so we'll modify it...
dataset = system.secsgem.toTreeDataset(dataset)
# ...and now pass the dataset into the Tree View component's data property.
event.source.parent.getComponent('Tree View').data = dataset