cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Networks and Tree widget

vishp
1-Newbie

Networks and Tree widget

I binding the data from the GetNetworkConnections to the Tree widget.  Is there a way to display the Thing entity description as opposed to the camel case Thing name ?

4 REPLIES 4
AdamR
12-Amethyst
(To:vishp)

You will need to create your own script and data shape.  Here is a script example...

var params = {

maxDepth : 9999

};

var conn = Networks['OGNetwork'].GetNetworkConnections(params);


var params = {

dataShapeName : "NetworkConnectionDesc",

infoTableName : "InfoTable"

};

var result = Resources['InfoTableFunctions'].CreateInfoTableFromDataShape(params);


for each (row in conn.rows) {

result.AddRow({to : row.to,

from : row.from,

connectionType : row.connectionType,

toDescription : Things[row.to].description,

toLocation : Things[row.to].Location,

toIcon : Things[row.to].IconType});

}



matthewp
1-Newbie
(To:AdamR)

What should the data shape look like?

paic
1-Newbie
(To:matthewp)

To visualize the information in a Tree Widget, you need Child and Parent (sometimes we call it to and from which is what a Network has by default)

Top nodes will have the Child information filled out with the Parent as "" and after that each child will have both filled out.

vishp
1-Newbie
(To:vishp)

Great.  Thank you

Top Tags