Organigram Renderer"

From Documentation
m ((via JWB))
m (remove empty version history (via JWB))
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
  {{ZK EE}}
 
  {{ZK EE}}
[Since 8.6.0]
+
{{versionSince|8.6.0}}
  
When an organigram (<javadoc>org.zkoss.zkmax.zul.Organigram</javadoc>) is assigned with a model, a default renderer is assigned too<ref>For the concept about component, model and renderer, please refer to [[ZK_Developer's_Reference/MVC/Model/List_Model#Model-driven_Display|the Model-driven Display section]].</ref>. The default renderer will assume that each Orgitem has one Orgnode, and it converts the data into a string directly<ref>If the Organigram is assigned a template called <tt>model</tt>, then the template will be used to render the Organigram. For more information, please refer to [[ZK Developer's Reference/MVC/View/Template/Organigram Template|the Organigram Template section]].</ref>. If you want to change render style or retrieve a particular field of the data, you have to implement <javadoc type="interface">org.zkoss.zkmax.zul.OrgitemRenderer</javadoc> to handle the rendering.
+
When an organigram (<javadoc>org.zkoss.zkmax.zul.Organigram</javadoc>) is assigned with a model, a default renderer is assigned too<ref>For the concept about component, model and renderer, please refer to [[ZK_Developer's_Reference/MVC/Model/List_Model#Model-driven_Display|the Model-driven Display section]].</ref>. The default renderer will assume that each Orgitem has one Orgnode, and it converts the data into a string directly<ref>If the Organigram is assigned a template called <code>model</code>, then the template will be used to render the Organigram. For more information, please refer to [[ZK Developer's Reference/MVC/View/Template/Organigram Template|the Organigram Template section]].</ref>. If you want to change render style or retrieve a particular field of the data, you have to implement <javadoc type="interface">org.zkoss.zkmax.zul.OrgitemRenderer</javadoc> to handle the rendering.
  
 
For example,
 
For example,
Line 30: Line 30:
 
</blockquote>
 
</blockquote>
  
=Version History=
+
 
{{LastUpdated}}
 
{| class='wikitable' | width="100%"
 
! Version !! Date !! Content
 
|-
 
| 8.6.0
 
| Oct 2018
 
| The organigram component was introduced.
 
|}
 
  
 
{{ZKDevelopersReferencePageFooter}}
 
{{ZKDevelopersReferencePageFooter}}

Latest revision as of 04:38, 5 February 2024


Organigram Renderer


  • Available for ZK:
  • http://www.zkoss.org/product/zkhttp://www.zkoss.org/whyzk/zkeeVersion ee.png

Since 8.6.0

When an organigram (Organigram) is assigned with a model, a default renderer is assigned too[1]. The default renderer will assume that each Orgitem has one Orgnode, and it converts the data into a string directly[2]. If you want to change render style or retrieve a particular field of the data, you have to implement OrgitemRenderer to handle the rendering.

For example,

	public class MyRenderer implements OrgitemRenderer {
		public void render(Orgitem orgitem, Object data, int index) throws Exception {
			final Button button = new Button(Objects.toString(data));
			button.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
				public void onEvent(Event event) {
					Clients.showNotification(button.getLabel());
				}
			});

			Orgnode orgnode = new Orgnode();
			button.setParent(orgnode);
			orgnode.setParent(orgitem);
		}
	}

  1. For the concept about component, model and renderer, please refer to the Model-driven Display section.
  2. If the Organigram is assigned a template called model, then the template will be used to render the Organigram. For more information, please refer to the Organigram Template section.




Last Update : 2024/02/05

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.