Search
Diagram.addItem Method
See Also
 






Adds an item to the Diagram.

Namespace: MindFusion.Diagramming
File: Diagram.js

 Syntax

JavaScript  Copy Code

function addItem (item)

 Parameters

item
The DiagramItem to add.

 Remarks

This method is called internally by methods of the Factory class. You should call it explicitly only if instantiating items using the new operator.

 Example

JavaScript  Copy Code

var node1 = new ShapeNode(diagram);
node1.bounds = new Drawing.Rect(20, 20, 30, 30);
diagram.addItem(node1);

var node2 = diagram.factory.createShapeNode(60, 20, 30, 30);

 See Also