Organigram"

From Documentation
Line 57: Line 57:
 
<organigram width="600px" model="${model}"/>
 
<organigram width="600px" model="${model}"/>
 
</source>
 
</source>
 +
 +
=Supported Events=
 +
 +
{| border="1" | width="100%"
 +
! <center>Name</center>
 +
! <center>Event Type</center>
 +
|-
 +
| <center><tt>onSelect</tt></center>
 +
| '''Event:''' <javadoc>org.zkoss.zk.ui.event.SelectEvent</javadoc>
 +
Notifies one that the user has selected a new item in the organigram.
 +
|-
 +
|}
 +
*Inherited Supported Events: [[ZK_Component_Reference/Base_Components/XulElement#Supported_Events | XulElement]]

Revision as of 04:17, 8 August 2018

Organigram

[ ZKEE ]
[ Since 8.6.0 ]

Employment/Purpose

Organigram is a component for showing organizational chart by using tree data structure, it also support TreeModel to hold data, Organigram only accept one Orgchildren as child, developers can put Orgchildren, Orgitem and Orgnode in Organigram to display data.

Example

	<organigram width="600px">
		<orgchildren>
			<orgitem>
				<orgnode label="Item1"/>
				<orgchildren>
					<orgitem>
						<orgnode label="Item2"/>
						<orgchildren>
							<orgitem>
								<orgnode label="Item3"/>
							</orgitem>
							<orgitem>
								<orgnode label="Item4"/>
								<orgchildren>
									<orgitem>
										<orgnode label="Item5"/>
									</orgitem>
								</orgchildren>
							</orgitem>
						</orgchildren>
					</orgitem>
					<orgitem>
						<orgnode label="Item6"/>
					</orgitem>
				</orgchildren>
			</orgitem>
		</orgchildren>
	</organigram>


	<zscript><![CDATA[
	DefaultTreeNode root = new DefaultTreeNode(null, new DefaultTreeNode[]{
		new DefaultTreeNode("Item1", new DefaultTreeNode[]{
			new DefaultTreeNode("Item2"), new DefaultTreeNode("Item3"), new DefaultTreeNode("Item4")
		})
	});
	DefaultTreeModel model = new DefaultTreeModel(root);
	model.addOpenPath(new int[]{0});
    ]]></zscript>
	<organigram width="600px" model="${model}"/>

Supported Events

Name
Event Type
onSelect
Event: SelectEvent

Notifies one that the user has selected a new item in the organigram.