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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

using ptcsgrid for displaying a tree grid

AK_10638440
4-Participant

using ptcsgrid for displaying a tree grid

hello all,

 

I'm using thingworx 9.5 and I'm trying to configure it for displaying a tree, It's not clear for me the needed infotable and how I need to configure the ptcsgrid widget for this.

 

any hint, example, tutorial, documentation is apreciated

 

11 REPLIES 11

Hi, @AK_10638440  Can you take a look at the below article and let us know if it will work in your case or not? 

 

https://www.ptc.com/en/support/article/CS329539

Hi Surya,

 

the tree grid advanced you proposed is a legacy widget in Thingworx 9.5. I'm trying to use the new grid widget which can be used for a tree view also, but I'm not sure how 

Hi @AK_10638440  Thingworx has a tree widget also, can you take a look if it can fulfill your use case, I will try your above scenario and let you know my findings.

Hi @Surya_Tiwari 

 

I know about tree widget, but the grid are more customizable, so I would prefer that.

If i remember correctly, you have to provide the column names for parentId maybe also HasChildrenFieldName.

ChildData can be the same infotable as Data.

iguerra
15-Moonstone
(To:Rocko)

An example of the data to be used and related fields would be very appreciated 

Service getTree:

result = Resources["InfoTableFunctions"].CreateInfoTable();
result.AddField({name:"id", baseType:"INTEGER"});
result.AddField({name:"parentId", baseType:"INTEGER"});
result.AddField({name:"name", baseType:"STRING"});
result.AddField({name:"hasChildren", baseType:"BOOLEAN"});

result.AddRow({id:1, name:"Europe", hasChildren:true});
result.AddRow({id:2, parentId:1, name:"CER", hasChildren:true});
result.AddRow({id:4, parentId:2, name:"Germany"});
result.AddRow({id:5, parentId:2, name:"Switzerland"});
result.AddRow({id:3, parentId:1, name:"NER", hasChildren:true});
result.AddRow({id:6, parentId:3, name:"Sweden"});

 

Binding:

Rocko_0-1732609956890.png

 

wcui
16-Pearl
(To:iguerra)

@AK_10638440 

Please check below link for steps to display tree with Grid widget in ThingWorx 9.6

https://support.ptc.com/help/thingworx/platform/r9.6/en/index.html#page/ThingWorx/Help/Mashup_Builder/Widgets/Grid_AddingAGridWidgetToaMashupdita.html#

 

Also, Rocko shared an example how to create data source for Grid.

Rocko
18-Opal
(To:wcui)

iguerra
15-Moonstone
(To:Rocko)

Thank you  @Rocko 
I was able to get it working.

 

wcui
16-Pearl
(To:iguerra)

@iguerra

It appears that Rocko answered your question.  For the benefit of other Community Members who may have the same question, it would be great if you could designate it as the Accepted Solution.

In the event that this response did not answer your question, please post your current status so that we can continue to support.

Thanks for using the PTC Community!

Regards,
wcui

Announcements


Top Tags