I need help with navigation using tree view.
I want to use tree view to access data for different devices.
For example, in the image, if I select East Area/Process/Valve1, I need to see the status and operating hour of Valve1 and if I select East Area/Process/Valve2, I need to see the status and operating hour of that Valve2. I have all data coming to my gateway. How do I configure?
This looks like Vision--you should update you subject to include that tag via the pencil icon--but similar techniques would apply to Perspective, too.
Presumably the right hand side of your window is a template canvas or other mutable display. If the TreeView is in a dock, then the right hand side would be your main windows.
The basic procedure would be:
-
Include in your TreeView's dataset extra columns that carry the static information you need with each selectable item to configure what to display on the right along with the parameters the windows/templates need to look up any dynamic information (tag paths, et cetera).
-
Monitor the tree view's selection with a property change script, and have the script extract the configuration and parameterization from the tree's dataset and pass to the right-hand objects.
Hi,
Thank you for your response.
I did not understand which field I should edit. I have stored the device information and the data tag path in my database table. I also have some parameters to set the hierarchy. Will it be possible to do it?
Is your tree view in a docked window, the the right hand side being different windows? Or is this all in one window? What kinds of data do you need to display on the right?
Share more details. A lot more details. {More detailed mockups? Sample of your heirarchy dataset?)
It is all in one window. I am using the tree view in the same window.
I have my database column in the following format.
I want to have the hierarchy in tree view as device_type/location/asset_code.
So, you need a Named Query that will supply all of the columns the treeview needs (path and name in particular), using SQL concat() to construct the "right" content in the expected column names. (Look at the sample dataset for the columns and column types you need.)
Include the asset code, device type, and tag_paths columns as extra data in the result dataset. You can use the selection information of the treeview to extract those from the selected row.
Bind the named query to the tree view's data.
Please show the variations for the right hand side you need to display.
Hi, thank you for your response.
It worked as I expected. I have one additional doubt. I want to display the asset_code (SG202405) as the end node. But here it is showing an additional item node under it (Item 6). How can i fix it?
Don't include the end node name in the path. Just in the name column.
Hello, I tried that, but now the asset_code is being shown as item as well.
I used my query like,
CONCAT(parent_id, '/', device_type, '/', location) AS path,
device_id AS name
FROM
table_1
ORDER BY
parent_id;
Your query isn't ordered by the parts of the path--the tree elements that belong together must be consecutive in the dataset.
Your query is also omitting columns that the documentation shows are non-optional.
"name" should be "text". Sorry about that.
Thank you so much. It worked.