Skip to main content
1-Visitor
April 29, 2019
Question

Unable to display root of the tree in Tree widget

  • April 29, 2019
  • 1 reply
  • 3128 views

Hi,

 

I'm using tree widget which will get input in a dynamic way.

 

I have used State as root element of tree, District, Substation and some other as children of the tree, Based on the user organization level of the user, I'm filtering the data and passing as input to the tree.  such as Bangalore is district I have Koramangala and HSR are 2 substations/divisions. It has other sub elements. 
I have attached the output.

But expected output has to be like the root element and the below tree structure under the root.

 

Is there any possibilities to display tree structure including root element??

 

Thanks in advance

1 reply

22-Sapphire I
April 29, 2019

You aren't showing the actual table of information, but usually you would have a 'ID' with the Root name and it's 'ParentID' value would be null

or if you look at Thingworx networks it would be a To with a null From

BhavyaPC1-VisitorAuthor
1-Visitor
April 30, 2019

@PaiChung , sorry for not sharing infotable earlier.

 

Since I Didn't get root element in the tree Earlier I have added one more row, same as root element but there is no use of doing so.

It's working fine with Collapsible D3 tree widget but not with tree and D3 tree widget.

I can't use Collapsable D3 tree widget because it will grow horizontally, which will not fit for my requirement.

22-Sapphire I
April 30, 2019

I see you have the root listed twice, that might potentially cause an error.