Search
DiagramDocument Class
Remarks See Also
 






Represents a collection of diagram pages.

Namespace: MindFusion.Diagramming
File: DiagramDocument.js

 Syntax

JavaScript  Copy Code

// class
DiagramDocument.prototype = {}

 Remarks

The DiagramDocument class represents a collection of diagram pages or sheets, represented by DiagramPage objects. New pages can be added to the document and existing pages can be removed and reordered by using the addPage and removePage methods respectively. The toJsonsaveToXml and saveToString methods of DiagramDocument save all pages in a single file, and respectively the fromJsonloadFromXml and loadFromString methods load all pages from the file. DiagramDocument can also load files created by the serialization methods of Diagram, and will show them in a single page.

DiagramPage is derived from Diagram and only adds a few properties, so any code that processes Diagram objects will work with DiagramPage objects too. A diagram document forwards each event raised by its pages, giving you a chance to use the same handler for events raised by different pages. If a page should implement distinct user interaction or validation logic, it is also possible to attach handlers to the Diagram events inherited by DiagramPage.

A single DiagramPage could be assigned to the diagram property of DiagramView, and that lets you create your own user interface for presenting a list of pages to the user and selecting a current page. The package also includes a TabbedDiagramView that presents all pages of a document in a tabbed user interface where each tab corresponds to a page. The page displayed in the active tab is exposed by the selectedPage property of TabbedDiagramView. The active page can be changed interactively by activating its associated tab. New pages can be added and removed to / from the document through buttons in the tab strip and the pages can be rearranged by dragging their associated tabs with the mouse.

 Inheritance Hierarchy

MindFusion.Diagramming.DiagramBase
    MindFusion.Diagramming.DiagramDocument

 See Also