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

Using setDataProperty with hierarchical model data

$
0
0

@dev wrote:

If i have model data on a node such as

{
  key: 'myUID',
  text: 'my text for label',
  serverObject0: {id: 5, prop0: 'A'},
  serverObject1: {id: 20, prop1: 'B'}
}

Is it possible to use something like

  model.setDataProperty(node.data, 'serverObject0.prop0', newPropertyValue);

to set a new property value on one of the child objects?

More generally, can I set a property that is hierarchical? Or do all properties have to be flattened in the model? If they do need to be flattened, what is the best practice to handle multiple objects that correspond to a single node?

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles