TreeModel$Typings extension

on

Properties

nodeParentKeyProperty Object
Gets or sets the name of the property on node data that specifies the string or number key of the node data that acts as the "parent" for this "child" node data. The value may also be a function taking two arguments, where the first argument will be a node data object. If the second argument is not supplied, the function should return the string or number key for the parent node data object of which the given data object is a child; if the second argument is supplied, the function should modify the node data object so that it has that new key (which may be undefined to refer to no node) as the parent key for that node.. The default value is the name 'parent', meaning that it expects the data to have a property named 'parent' if the node wants to refer to the parent node by its key. The value must not be null nor an empty string.
getter/setter pair
parentLinkCategoryProperty Object
Gets or sets the name of the data property that returns a string describing that node data's parent link's category. The value may also be a function taking two arguments, where the first argument will be a node data object. If the second argument is not supplied, the function should return the category name for any parent link; if the second argument is supplied, the function should modify the node data object so that its parent link has that new category name. The default value is the name 'parentLinkCategory'. This is used by the diagram to distinguish between different kinds of links. The name must not be null. If the value is an empty string, #getParentLinkCategoryForNodeData will return an empty string for all node data objects.
getter/setter pair

Methods

copyNodeData(Object nodedata) Object?
This override also makes sure any copied node data does not have a reference to a parent node. @expose @param {Object} nodedata a JavaScript object represented by a node, group, or non-link. @return {Object} @see Model#copyNodeData
getParentKeyForNodeData(Object nodedata) → dynamic
If there is a parent node for the given node data, return the parent's key. @param {Object} nodedata a JavaScript object represented by a node. @return {string|number|undefined} This returns undefined if there is no parent node data object. @see #nodeParentKeyProperty @see #setParentKeyForNodeData
getParentLinkCategoryForNodeData(Object childdata) String
Find the category for the parent link of a given child node data, a string naming the link template that the Diagram should use to represent the link. @param {Object} childdata a JavaScript object represented by a node data. @return {string} @see #parentLinkCategoryProperty @see #setParentLinkCategoryForNodeData
setDataProperty(Object data, String propname, [dynamic val]) → void
This override changes the value of some property of a node data or an item data, given a string naming the property and the new value, in a manner that can be undone/redone and that automatically updates any bindings.
setParentKeyForNodeData(Object nodedata, dynamic key) → void
Change the parent node for the given node data, given a key for the new parent, or undefined if there should be no parent. @param {Object} nodedata a JavaScript object represented by a node. @param {string|number|undefined} key This may be undefined if there should be no parent node data. @see #nodeParentKeyProperty @see #getParentKeyForNodeData
setParentLinkCategoryForNodeData(Object childdata, String cat) → void
Change the category for the parent link of a given child node data, a string naming the link template that the Diagram should use to represent the link.