two Subviews (not nested) in data tables

edited February 22 in Technical questions

I have a json data which i am trying to present in UI. I can only add one object to the subview. In below sample.
I have a ChangeObject(objid,name)-->coverpage/affectedItems
I am able to display the Change and coverpage, how should i show the affected items of coverage?

[
  {
    "objectID": "6018532",
    "name": "C00001",
    "coverPage": {
      "Number": "C00001",
      "Status": "Released",
      "Change Type": "ECO",
      "Date Originated": "Sat Aug 22 14:56:21 PDT 2020"
    },
    "affectedItems": [
      {
        "aiAttributes": {
          "Item Number": "D00001",
          "Item Description": "Description of D00001"
        }
      },
      {
        "aiAttributes": {
          "Item Number": "P00001",
          "Item Description": "Part1 desc"
        }
      },
      {
        "aiAttributes": {
          "Item Number": "P00002",
          "Item Description": "Second Part"
         }
      }
    ]
  },
  {
    "objectID": "6018565",
    "name": "C00002",
    "coverPage": {
      "Number": "C00002",
      "Status": "Released",
      "Change Type": "ECO",
      "Date Originated": "Sat Aug 22 15:09:14 PDT 2020"
    },
    "affectedItems": [
      {
        "aiAttributes": {
          "Item Number": "D00001",
          "Item Description": ""
        }
      },
      {
        "aiAttributes": {
          "Item Number": "D00002",
          "Item Description": ""
        }
      },
      {
        "aiAttributes": {
          "Item Number": "P00001",
          "Item Description": ""
        }
      },
      {
        "aiAttributes": {
          "Item Number": "P00002",
          "Item Description": ""
        }
      }
    ]
  },
  {
    "objectID": "6020083",
    "name": "C00004",
    "coverPage": {
      "Number": "C00004",
      "Status": "Released",
      "Change Type": "ECO",
      "Originator": "Administrator, c (admin)"
    },
    "affectedItems": [
      {
        "aiAttributes": {
          "Item Number": "D00001",
          "Item Description": ""
        }
      },
      {
        "aiAttributes": {
          "Item Number": "D00002",
          "Item Description": ""
        }
      },
      {
        "aiAttributes": {
          "Item Number": "P00001",
          "Item Description": "test",
          "Old Rev": "B",
          "New Rev": "D",
          "Old Lifecycle Phase": "Production",
          "Lifecycle Phase": "Production"
        }
      },
      {
        "aiAttributes": {
          "Item Number": "P00002",
          "Item Description": "",
          "Change Function": "",
          "Old Rev": "C",
          "New Rev": "D",
          "Old Lifecycle Phase": ""
        }
      }
    ]
  }
]

the Webix Code I have:

        webix.ui({
              view:"datatable",
              subview:{
                borderless:true,
                view:"datatable",
                headerRowHeight:28,
                editable:true,
                columns:[
                  { id:"Number", header:"Number", sort:"string", fillspace:true,editor:"text" },
                  { id:"Status" , header:"Status", editor:"text"},
                  { id:"Date Originated", header:"DateOriginated", editor:"text"},
                  { id:"Change Type", header:"Type", editor:"text" }
                ],
                scrollX:false,
                autoheight:true
              },
              on:{
                onSubViewCreate:function(view, item){
                  view.parse(item.coverPage);
                    //view.parse(item.affectedItems);
                }
              },
              columns:[
                { id:"objectID",    header:"ID", sort:"string",  editor:"text",
                 template:"{common.subrow()} #objectID#", width:220 },
                { id:"name",    header:"ChangeNumber",      width:200, editor:"text"}
              ],
              editable:true,
              autoheight:true,
              autowidth:true,
              url: "Sample_SubviewData.json"
            });
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!