setKeyForNodeData method

void setKeyForNodeData(
  1. Object nodedata,
  2. dynamic key
)

Change the unique key of a given node data that is already in this model. The new key value must be unique -- i.e. not in use by another node data object. You can call #findNodeDataForKey to check if a proposed new key is already in use.

This operation will check all data objects in the model and replace all references using the old key value with the new one.

If this is called on a node data object that is not (yet) in this model, this unconditionally modifies the property to the new key value. @param {Object} nodedata a JavaScript object represented by a node, group, or non-link. @param {string|number} key @see #nodeKeyProperty @see #getKeyForNodeData @since 1.1

Implementation

void setKeyForNodeData(
  _i2.Object nodedata,
  _i2.dynamic key,
) {
  _i4.callMethod(
    this,
    'setKeyForNodeData',
    [
      nodedata,
      key,
    ],
  );
}