Mold"

From Documentation
m (Created page with '{{ZKDevelopersGuidePageHeader}} A component could have different appearance even at the same page. The concept is called mold (aka., template). Developers could dynamically chan…')
 
m (correct highlight (via JWB))
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
{{ZKDevelopersGuidePageHeader}}
 
{{ZKDevelopersGuidePageHeader}}
  
A component could have different appearance even at the same page. The concept is called mold (aka., template). Developers could dynamically change the mold by use of the setMold method in the Component interface. All components support a mold called <tt>default</tt>, which is the default value. Some components might have support two or more molds For example, tabbox supports both default and accordion molds.
+
A component could have different appearance even at the same page. The concept is called mold (aka., template). Developers could dynamically change the mold by use of the setMold method in the Component interface. All components support a mold called <code>default</code>, which is the default value. Some components might have support two or more molds For example, tabbox supports both default and accordion molds.
  
If <tt>tabbox</tt>'s <tt>mold</tt> is not set, it use default mold.
+
If <code>tabbox</code>'s <code>mold</code> is not set, it use default mold.
 
<source lang="xml" >
 
<source lang="xml" >
 
<tabbox>
 
<tabbox>
Line 17: Line 17:
 
</source>
 
</source>
  
Set <tt>tabbox</tt>'s mold to "accordion",  
+
Set <code>tabbox</code>'s mold to "accordion",  
 
<source lang="xml" >
 
<source lang="xml" >
 
<tabbox mold="accordion">
 
<tabbox mold="accordion">
Line 30: Line 30:
 
</tabbox>
 
</tabbox>
 
</source>
 
</source>
 
*[[How do we know what molds does a component has?]]
 
*[[How to implement your own mold?]]
 
  
 
{{ ZKDevelopersGuidePageFooter}}
 
{{ ZKDevelopersGuidePageFooter}}

Latest revision as of 10:41, 19 January 2022

Stop.png This documentation is for an older version of ZK. For the latest one, please click here.


A component could have different appearance even at the same page. The concept is called mold (aka., template). Developers could dynamically change the mold by use of the setMold method in the Component interface. All components support a mold called default, which is the default value. Some components might have support two or more molds For example, tabbox supports both default and accordion molds.

If tabbox's mold is not set, it use default mold.

<tabbox>
	<tabs>
		<tab label="First tab" />
		<tab label="Second tab" />
	</tabs>
	<tabpanels>
		<tabpanel>The first panel.</tabpanel>
		<tabpanel>The second panel.</tabpanel>
	</tabpanels>
</tabbox>

Set tabbox's mold to "accordion",

<tabbox mold="accordion">
	<tabs>
		<tab label="First tab" />
		<tab label="Second tab" />
	</tabs>
	<tabpanels>
		<tabpanel>The first panel.</tabpanel>
		<tabpanel>The second panel.</tabpanel>
	</tabpanels>
</tabbox>



Last Update : 2022/01/19

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