📄 b30-1869003.zul
字号:
<?xml version="1.0" encoding="UTF-8"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit"?>
<window id="testwin" xmlns="http://www.zkoss.org/2005/zul"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<html><![CDATA[
1. Select checkbox of the first row.<br/>
2. Click on the "Click Me" column header in "Top Grid" and the checked row is removed.<br/>
3. The checkbox of the new first row should not be checked.(Error if you see it checked)<br/>
]]></html>
<zscript>
import java.util.ArrayList;
import java.util.HashSet;
public class Base
{
public String name;
public Base(String n)
{
this.name=n;
this.items = new HashSet();
}
};
Set _wdBundles = new HashSet();
baseA = new Base("Row A");
_wdBundles.add(baseA);
baseB = new Base("Row B");
_wdBundles.add(baseB);
baseC = new Base("Row C");
_wdBundles.add(baseC);
void removeTop(Grid g)
{
rows = g.getFellow("topgrid");
List rowList = new ArrayList(rows.getChildren());
int x = 0;
for(Row r:rowList)
{
Checkbox check = (Checkbox) r.getFirstChild();
if(check.isChecked())
{
g.getModel().remove(r.getValue());
}
}
}
</zscript>
<grid id="mygrid" mold="paging" pageSize="8" width="600px" model="@{_wdBundles}">
<columns>
<column label="Click Me" onClick="removeTop(self.parent.parent)"/>
<column label="Bundle" width="35%"/>
</columns>
<rows id="topgrid">
<row self="@{each='bundle'}" value="@{bundle}">
<checkbox/>
<label value="@{bundle.name}"/>
</row>
</rows>
</grid>
</window>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -