Angular JS - Point Hierarchy – Display Tree
-
In the Angular JS - Point Hierarchy – Display Tree.
When testing the code I can’t get a list. I see the tree with my point count. But the table is blank under the headings?????? I was trying to use this as a way to list XID’s on a page. I tried using the play area but same thing. No points or XID’s. Any help would be nice.
Larry -
I think this example is more demonstrating of what could be built based on the <ma-point-hierarchy> to query and how you could display these points. The display tree itself isn't exactly a ready to go UI component but I guess you could use it and modify it to your needs.
I think the key thing with using the display tree is you use the checkboxes to drill down into the hierarchy structure, and you click on a folder name to display the points under it in the table below.
-
Will, You are so right! I didn't click on the folder name. It works well. Thanks so much.
Larry -
HI,
I was extending this example to print point value- but it is not showing up.
<h3>Points table</h3>
<md-table-container ng-init="page.tableOrder='name'">
<table md-table="">
<thead md-head="" md-order="page.tableOrder">
<tr>
<th md-column="" md-order-by="name">Point name</th>
<th md-column="" md-order-by="value">Point value</th>
<th md-column="" md-order-by="xid">XID</th>
</tr>
</thead>
<tbody md-body="" ng-init="total = 0">
<tr ng-repeat="point in page.points | orderBy: page.tableOrder"><td md-cell=""> <img ng-src="{{point.deviceName.indexOf('Meta') > -1 ? '/rest/v2/file-stores/default/xximages/ye.png' : '/rest/v2/file-stores/default/xximages/yerat.png'}}" width="16px" height="16px"> {{point.name}}</td> <ma-get-point-value point="point"></ma-get-point-value> <td md-cell="">{{point.value}}</td> <td md-cell="">{{point.xid}}</td> </tr> </tbody> </table> </md-table-container>
-
Hi KKS,
The "page.points" object modeled by the hierarchy are DataPointSummary objects instead of full points. So, in the cell where you're wanting the value displayed you could do,
<ma-point-value point-xid="{{point.xid}}"></ma-point-value>
And it'll load the point and its value behind the scenes and put the value there... which isn't really the most efficient way to go about this. If you can create a watchlist from your hierarchy folder, then you can use the watchlist directives to load the points and their values from that reference instead. But, in the context of this example fetching the value as I showed should work fine.
-
Thank you so much. I appreciate you help.