grid.zul

来自「ZK是一个Ajax Java Web框架」· ZUL 代码 · 共 106 行

ZUL
106
字号
<?xml version="1.0" encoding="UTF-8"?><!--grid.zul{{IS_NOTE	Purpose:			Description:			History:		Thu Nov 13 16:11:50     2008, Created by jumperchen}}IS_NOTECopyright (C) 2008 Potix Corporation. All Rights Reserved.{{IS_RIGHT}}IS_RIGHT--><window id="demo" apply="org.zkoss.zkdemo.userguide.DemoWindowComposer">
	<html><![CDATA[
		<h4>Grids</h4>
   		<p>Layout components into tabular format by the use of columns and rows.</p>
	]]></html>
	<separator/>
	<tabbox width="100%" tabscroll="false">
		<tabs>
			<tab id="demoView" label="Demo"/>
			<tab id="srcView" label="View Source"/>
		</tabs>
		<tabpanels>
			<tabpanel>
				<window id="view">
				</window>
			</tabpanel>
			
			<tabpanel>
				<panel>
					<panelchildren>
						<textbox id="codeView" class="code" rows="20" width="95%">
			<attribute name="value"><![CDATA[
<zk>
<!-- Due to the security constraint, ZK demo site doesn't allow
	zscript to declare a class. Instead we use a pre-compiled Java class.
	You can uncomment the following and try it in your local server.
	<zscript>
	class Comp implements Comparator {
		private boolean _asc;
		public Comp(boolean asc) {
			_asc = asc;
		}
		public int compare(Object o1, Object o2) {
			String s1 = o1.getChildren().get(0).getValue(),
				s2 = o2.getChildren().get(0).getValue();
			int v = s1.compareTo(s2);
			return _asc ? v: -v;
		}
	}
	Comp asc = new Comp(true), dsc = new Comp(false);
	</zscript>
-->
	<zscript>
	import org.zkoss.zkdemo.userguide.*;
	Comparator asc = new RowLabelComparator(true),
		dsc = new RowLabelComparator(false);
	</zscript>
	<grid>
		<columns sizable="true">
			<column label="Type" sortAscending="&#36;{asc}" sortDescending="&#36;{dsc}"/>
			<column label="Content"/>
		</columns>
		<rows>
			<row>
				<label value="File:"/>
				<textbox width="98%"/>
			</row>
			<row>
				<label value="Type:"/>
				<hbox>
					<listbox rows="1" mold="select">
						<listitem label="Java Files,(*.java)"/>
						<listitem label="All Files,(*.*)"/>
					</listbox>
					<button label="Browse..."/>
				</hbox>
			</row>
			<row>
				<label value="Options:"/>
				<textbox rows="3" width="98%"/>
			</row>
		</rows>
	</grid>
</zk>
			]]></attribute>
						</textbox>
					</panelchildren>
					<toolbar mold="panel">
						<button id="tryBtn" label="Try me!"/>
						<button id="reloadBtn" label="Reload" height="18px"/>
					</toolbar>
				</panel>
			</tabpanel>
		</tabpanels>
	</tabbox>
</window>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?