Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Dynamically adding node data array

$
0
0

@Alpheus wrote:

Hi there,

I need help on how to add node data array from json string when trying with the code below i get: this[(palettes[i].PaletteName + palettes[i].Id.toString(...))].addNodeData is not a function

var savedFile = palettes[i].Layout;
var obj = JSON.parse(savedFile);
this[palettes[i].PaletteName + palettes[i].Id.toString()].model = $(go.GraphLinksModel,
{
copiesArrays: true,
copiesArrayObjects: true,

                    });  // end model
                for (var i = 0; i < obj.length; i++) {
                    this[palettes[i].PaletteName + palettes[i].Id.toString()].addNodeData(obj[i]);
                }

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles