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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Tree Widget Usage

svisveswaraiya
17-Peridot

Tree Widget Usage

Hi,

In order to represent a hierarchy of data in tree widget where should I fetch the service data? I tried to get a table from sql using select query but I was not able to display any runtime data in tree. How should I approach this to get output like the attachment?

treewidget.png

Thanks,

Shalini V.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @svisveswaraiya,

 

I see it is a bit confusing how the input should look. It seems like it must be something like this:

 

image1.jpg

 

and then your definitions under your tree widget must be:

 image2.jpg

  

where you have to define the RootParentID as a value in your selected ParentIDField as I did root in my first two rows. It is unclear from the video that this is required because the output from the GetNetworkConnections service has a value that is blank as below:image3.jpg

  

This means that your output from the SQL query you would have to restructure into an infotable similar in structure as above.

 

The result would then look something like this:

image4.jpg

I hope this has given some more clarity.

View solution in original post

4 REPLIES 4

Hi @svisveswaraiya,

 

You need to provide an infotable as input to the tree widget that has at least two columns, a parent ID and a sub-heading ID which you should define in your widget configuration in the mashup editor. The output from the SQL select query should work, maybe it is something in the configuration of the widget.

 

There is a video that can be found in the help file as well: https://www.youtube.com/watch?v=JHToI9VDZ78

 

http://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/#page/ThingWorx%2FHelp%2FMashup_Builder%2FWidgets%2FTreeWidget.html

 

Hope this helps,

Kind regards,

Johan Bester

Hi jbester,

Thanks for your swift response. I referred the video but they are using the network but I am using the database table. I have attached the property configuration that I have set and my grid data. Please tell me what changes I should be making to get the output.

treewidget.pngruntimetreewidget.png

Hi @svisveswaraiya,

 

I see it is a bit confusing how the input should look. It seems like it must be something like this:

 

image1.jpg

 

and then your definitions under your tree widget must be:

 image2.jpg

  

where you have to define the RootParentID as a value in your selected ParentIDField as I did root in my first two rows. It is unclear from the video that this is required because the output from the GetNetworkConnections service has a value that is blank as below:image3.jpg

  

This means that your output from the SQL query you would have to restructure into an infotable similar in structure as above.

 

The result would then look something like this:

image4.jpg

I hope this has given some more clarity.

slangley
23-Emerald II
(To:jbester)

Hi @svisveswaraiya 

 

If one of the responses provided by @jbester helped to resolve your issue, please mark the appropriate one as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon

Top Tags