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 PTC Community Badges. Engage with PTC and see how many you can earn! X

How to display a nested table in ThingWorx mashup

No ratings

Here is a demo that uses repeater widget and smart grid widget to display a nested table.

  • Note: This demo is for testing use.
    1. Create a datashape for  the nested datatable named DataTableStructure
      • User-added image
      • Create DataShape named InfoStructure for Obj
        • User-added image
    2. Create the nested datatable named DataTableTest as below
      • User-added image
      • Create a service named AddObjInput as below in this datatable
        • User-added image
    3. Crate a Mashup named RepeaterMshUser-added image
      • Add widgets like textbox, label, button and smart grid on the mashup
        • User-added image
      • There are some parameters we added before, please bind them to the widgets that we just added to the mashup
        • User-added image
      • Add DataTableTest service AddOrUpdateDataTableEntry to the mashup. Bind textbox and smart grid edited table to AddOrUpdateDataTableEntry parameter. Bind button click event to trigger the service AddOrUpdateDataTableEntry
        • User-added image
      • The smart grid widget need a special attribute named TableDefinition
        • This demo sample is{"columns":[{"name":"PrimarySchool","type":"text","display":"PrimarySchool"},{"name":"SecondarySchool","type":"text","display":"SecondarySchool"},{"name":"HighSchool","type":"text","display":"HighSchool"}]}
    4. Create mashup which has repeater widgets

      • The mashup over view is like below
      • The first part is aimed to add a new record, the second part (repeater widget)is aimed to display table data, and also update data.
        • User-added image
        • In the first part, there are textboxs, labels, smart grid and button widget.
        • They are banded to the service named AddDataTableEntry, aimed to add a new record in the table. (Smart grid is used to add the nested table data)
          • User-added image
          • There is a button named AddRecords, bind it’s clicked event to AddDataTableEntry service. And bind the AddDataTableEntry service’s event ServiceInvokeCompleteted to GetDataTableEntries
          • The smart grid widget in here is an empty grid, but it should have a structure at beginning. That’s why to create a service named AddObjInput in step2. It returns an empty table but with the datashape.
            • User-added image
    • The second part is a repeater widget.
    • Repeater widget has an attribute named Mashup, bind the mashup Repeatermsh. Bind GetDataTableEntries all data to the repeater widget. There should be some parameters that need to bind like gender, InfoTable, Sname…
    • Testing the demo
    • Note: Smart Grid widget is not a ThingWorx OOTB functionality
Comments

The Navigate extension also has the very cool TreeTable Widget extension which can be used to show embedded infotables.

Many thanks for your suggestion. I'll try and if it works, I'll added this part to my thread.

Version history
Last update:
‎May 10, 2017 10:06 PM
Updated by:
Labels (1)
Tags (1)