Columnlayout"

From Documentation
Line 15: Line 15:
 
<columnlayout>
 
<columnlayout>
 
<columnchildren width="30%" style="padding: 5px">
 
<columnchildren width="30%" style="padding: 5px">
<panel height="100px" style="margin-bottom:10p title=" column1-1 "
+
<panel height="100px" style="margin-bottom:10p"
border="normal" maximizable="true" collapsible="true">
+
title="column1-1" border="normal" maximizable="true"
 +
collapsible="true">
 
<panelchildren>Panel</panelchildren>
 
<panelchildren>Panel</panelchildren>
 
</panel>
 
</panel>
<panel height="100px" framable="true" title="column1- border="
+
<panel height="100px" framable="true" title="column1-2"
normal " maximizable="true" style="margin-bottom:10px">
+
border="normal" maximizable="true" style="margin-bottom:10px">
 
<panelchildren>Panel</panelchildren>
 
<panelchildren>Panel</panelchildren>
 
</panel>
 
</panel>
Line 32: Line 33:
 
style="margin-bottom:10px">
 
style="margin-bottom:10px">
 
<panelchildren>
 
<panelchildren>
<grid fixedLayout="true" style="border:0px" height="100%">
+
<grid fixedLayout="true" style="border:0px"
 +
height="100%">
 
<columns>
 
<columns>
 
<column label="category" />
 
<column label="category" />
Line 40: Line 42:
 
<row>
 
<row>
 
<label id="c0" value="C/C++" />
 
<label id="c0" value="C/C++" />
<decimalbox id="v0" value="21. constraint=" no empty "
+
<decimalbox id="v0"
onChange="update(0)" />
+
value="21." constraint="no empty" onChange="update(0)" />
 
</row>
 
</row>
 
<row>
 
<row>
 
<label id="c1" value="VB" />
 
<label id="c1" value="VB" />
<decimalbox id="v1" value="10. constraint=" no empty "
+
<decimalbox id="v1"
onChange="update(1)" />
+
value="10." constraint="no empty" onChange="update(1)" />
 
</row>
 
</row>
 
<row>
 
<row>
 
<label id="c2" value="Java" />
 
<label id="c2" value="Java" />
<decimalbox id="v2" value="40. constraint=" no empty "
+
<decimalbox id="v2"
onChange="update(2)" />
+
value="40." constraint="no empty" onChange="update(2)" />
 
</row>
 
</row>
 
<row>
 
<row>
 
<label id="c3" value="PHP" />
 
<label id="c3" value="PHP" />
<decimalbox id="v3" value="28. constraint=" no empty "
+
<decimalbox id="v3"
onChange="update(3)" />
+
value="28." constraint="no empty" onChange="update(3)" />
 
</row>
 
</row>
 
</rows>
 
</rows>
Line 66: Line 68:
 
<checkbox label="3D Chart" checked="true"
 
<checkbox label="3D Chart" checked="true"
 
onCheck="mychart.setThreeD(self.isChecked())" />
 
onCheck="mychart.setThreeD(self.isChecked())" />
<chart id="mychart" title="Pie Chart Demo" width="320p type="
+
<chart id="mychart" title="Pie Chart Demo"
pie " threeD="true" fgAlpha="128">
+
width="320px" type="pie" threeD="true" fgAlpha="128">
<attribute name="onClick"> String areaid = event.getArea(); if
+
<attribute name="onClick"><![CDATA[
(areaid!= null) { Area area = self.getFellow(areaid);
+
String areaid = event.getArea();
alert(""+area.getAttribute("entity")+":"+area.getTooltiptext()); }
+
if (areaid != null) {
</attribute>
+
Area area = self.getFellow(areaid);
<zscript> void update(int rowIndex) { Label lb = (Label)
+
alert("" + area.getAttribute("entity") + ":" + area.getTooltiptext());
self.getFellow("c"+rowIndex); Decimalbox db =
+
}
(Decimalbox)self.getFellow("v"+rowIndex); model.setValue(lb.value,
+
]]></attribute>
newDouble(db.getValue().doubleValue())); } PieModel model = new
+
<zscript><![CDATA[
SimplePieModel(); for(int j=0; j &lt; 4; ++j) { update(j); }
+
void update(int rowIndex) {
                            mychart.setModel(model);
+
Label lb = (Label) self.getFellow("c" + rowIndex);
                        </zscript>
+
Decimalbox db = (Decimalbox) self.getFellow("v" + rowIndex);
                </chart>
+
model.setValue(lb.value, new Double(db.getValue().doubleValue()));
            </panelchildren>
+
}
        </panel>
+
PieModel model = new SimplePieModel();
    </columnchildren>
+
for (int j = 0; j < 4; ++j) {
</columnlayout>
+
update(j);
 +
}
 +
mychart.setModel(model);
 +
]]></zscript>
 +
</chart>
 +
</panelchildren>
 +
</panel>
 +
</columnchildren>
 +
</columnlayout>
 +
 
 
</source>
 
</source>
  

Revision as of 08:33, 15 November 2010

Columnlayout

Employment/Purpose

A columnlayout lays out a container which can have multiple columns, and each column may contain one or more panel.Use Columnlayout need assign width (either percent or pixel) on every Columnchildren, or we cannot make sure about layout look.

Example

ZKComRef Columnlayout Example.png

<columnlayout>
	<columnchildren width="30%" style="padding: 5px">
		<panel height="100px" style="margin-bottom:10p"
			title="column1-1" border="normal" maximizable="true"
			collapsible="true">
			<panelchildren>Panel</panelchildren>
		</panel>
		<panel height="100px" framable="true" title="column1-2"
			border="normal" maximizable="true" style="margin-bottom:10px">
			<panelchildren>Panel</panelchildren>
		</panel>
		<panel height="100px" title="column1-3" border="normal"
			closable="true">
			<panelchildren>Panel</panelchildren>
		</panel>
	</columnchildren>
	<columnchildren width="40%" style="padding: 10px">
		<panel title="Data" maximizable="true" border="normal"
			style="margin-bottom:10px">
			<panelchildren>
				<grid fixedLayout="true" style="border:0px"
					height="100%">
					<columns>
						<column label="category" />
						<column label="value" />
					</columns>
					<rows>
						<row>
							<label id="c0" value="C/C++" />
							<decimalbox id="v0"
								value="21." constraint="no empty" onChange="update(0)" />
						</row>
						<row>
							<label id="c1" value="VB" />
							<decimalbox id="v1"
								value="10." constraint="no empty" onChange="update(1)" />
						</row>
						<row>
							<label id="c2" value="Java" />
							<decimalbox id="v2"
								value="40." constraint="no empty" onChange="update(2)" />
						</row>
						<row>
							<label id="c3" value="PHP" />
							<decimalbox id="v3"
								value="28." constraint="no empty" onChange="update(3)" />
						</row>
					</rows>
				</grid>
			</panelchildren>
		</panel>
		<panel border="normal">
			<panelchildren>
				<checkbox label="3D Chart" checked="true"
					onCheck="mychart.setThreeD(self.isChecked())" />
				<chart id="mychart" title="Pie Chart Demo"
					width="320px" type="pie" threeD="true" fgAlpha="128">
					<attribute name="onClick"><![CDATA[
						String areaid = event.getArea();
						if (areaid != null) {
							Area area = self.getFellow(areaid);
							alert("" + area.getAttribute("entity") + ":" + area.getTooltiptext());
						}
					]]></attribute>
					<zscript><![CDATA[
						void update(int rowIndex) {
							Label lb = (Label) self.getFellow("c" + rowIndex);
							Decimalbox db = (Decimalbox) self.getFellow("v" + rowIndex);
							model.setValue(lb.value, new Double(db.getValue().doubleValue()));
						}
						PieModel model = new SimplePieModel();
						for (int j = 0; j < 4; ++j) {
							update(j);
						}
						mychart.setModel(model);
					]]></zscript>
				</chart>
			</panelchildren>
		</panel>
	</columnchildren>
</columnlayout>

Supported events

Name
Event Type
None None

Supported Children

Columnchildren

Use cases

Version Description Example Location
     

Version History

Version Date Content
     



Last Update : 2010/11/15

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