I am trying to make the tree mapper https://gojs.net/latest/samples/treeMapper.html
implementation dynamic with the data:
recordSrc : Record[] = [
{
type: ‘entry’,
name: ‘Record 12’,
color: “lightblue”,
group: -1,
info: “”,
fields: [
{type: ‘entry’, color:"", name: ‘field11A’, info: “”, group: -1, links:[], fields: []},
{type: ‘entry’, color:"", name: ‘field11B’, info: “”, group: -1, links: [], fields: []},
],
links: []
}
];
recordTgt : Record[] = [
{
type: ‘entry’,
name: ‘Record 21’,
color: “lightblue”,
group: -2,
info: “”,
fields: [
{type: ‘entry’, color:"", name: ‘field21A’, info: “”, group: -2, links:[], fields: []},
{type: ‘entry’, color:"", name: ‘field21B’, info: “”, group: -2, links: [], fields: []},
],
links: []
}
];
I want to have Record 12 of recordSrc variable as a node with fields as its child nodes and similarly with the recordTgt.
Can anyone tell me a reference or a soultion to do the same?