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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Tree widget usage with Data Format

MA8731174
14-Alexandrite

Tree widget usage with Data Format

Hi everyone,

  I would like to use the Tree widget in mashup and my structure for now planned is look as below:-

 

- Step 01

   -- Sub step

   -- Sub step

-Step 02

   -- Sub step

   -- Sub step

 

So i am going only two levels down so parent and its child thats it. But i am unable to find the format of the data it accepts. Can someone please write the format which it accepts either they are an infotable into an infotable to access it or does it work otherwise?

 

Thanks

   

  

1 REPLY 1
knagata
14-Alexandrite
(To:MA8731174)

Hi,

To use the Tree widget in ThingWorx Mashup, you need to structure your data in a specific format. The Tree widget typically expects an infotable with specific fields to define the hierarchy. Here's a basic example of how you can structure your data:
- Infotable Structure:
   - ID: Unique identifier for each node.
   - Label: The display name of the node.
   - ParentID: The ID of the parent node (for root nodes, this can be null or a specific root identifier).
- Example Data:

[
   {
       "ID": "1",
       "Label": "Step 01",
       "ParentID": null
   },
   {
       "ID": "1.1",
       "Label": "Sub step",
       "ParentID": "1"
   },
   {
       "ID": "1.2",
       "Label": "Sub step",
       "ParentID": "1"
   },
   {
       "ID": "2",
       "Label": "Step 02",
       "ParentID": null
   },
   {
       "ID": "2.1",
       "Label": "Sub step",
       "ParentID": "2"
   },
   {
       "ID": "2.2",
       "Label": "Sub step",
       "ParentID": "2"
   }
]

- Binding the Data:
   - Bind this infotable to the Tree widget's Data property.
   - Set the IDField, LabelField, and ParentIDField properties to match the field names in your infotable.
This structure allows the Tree widget to understand the hierarchy and display it correctly.

Announcements


Top Tags