Suggested case list:
Using timer to refresh a grid
383guest172.69.33.12125nk0uiMay 7, 2020 7:23:47 AMlinkuser model to move item to another listbox
120guest162.158.193.148d0n3krApr 2, 2020 5:28:28 AMlinkDisabled list item row passed to VM-1981
296fatih123160.83.36.13025nk0uiFeb 13, 2018 4:25:44 PMlinkDisabled list item row passed to VM-1981
295fatih123160.83.36.13025nk0uiFeb 13, 2018 4:25:16 PMlinkDisabled list item row passed to VM-1981
294fatih123160.83.36.13225nk0uiFeb 13, 2018 3:30:44 PMlinkgrid sample with ListModel/RowRenderer
816guest80.82.2.1312vah9ajFeb 21, 2017 11:42:21 AMlinkgrid sample with ListModel/RowRenderer
809guest175.98.113.1622vah9ajJan 26, 2017 9:19:33 AMlinkgrid sample with ListModel/RowRenderer
196guest79.185.142.402vah9ajApr 26, 2014 10:53:57 PMlinkgrid sample with ListModel/RowRenderer
195guest79.185.142.402vah9ajApr 26, 2014 10:53:54 PMlinkgrid sample with ListModel/RowRenderer
194guest79.185.142.402vah9ajApr 26, 2014 10:53:51 PMlinkgrid sample with ListModel/RowRenderer
193guest79.185.142.402vah9ajApr 26, 2014 10:53:48 PMlinkgrid sample with ListModel/RowRenderer
192guest79.185.142.402vah9ajApr 26, 2014 10:53:44 PMlinkgrid sample with ListModel/RowRenderer
191guest79.185.142.402vah9ajApr 26, 2014 10:53:40 PMlinkHierarchy table without using ZK PE/EE
1aaknai151.28.135.2131s871daJul 29, 2013 11:02:46 PMlinkgrid sample with ListModel/RowRenderer
128aaknai151.28.135.2132vah9ajJul 29, 2013 7:20:00 PMlinkuser model to move item to another listbox
1TonyQ114.25.109.94d0n3krApr 21, 2012 10:43:27 AMlinkUsing timer to refresh a grid
1TonyQ220.133.44.3725nk0uiFeb 17, 2012 3:17:34 AMlinkFire a event from child iframe
1TonyQ220.133.44.372eupjotFeb 3, 2012 5:04:52 AMlinkTextbox input restriction sample
1TonyQ72.21.245.2431b3nlr0Dec 20, 2011 10:09:10 AMlinkTest web core taglib in ZUL
1TonyQ198.203.175.175ofqkemDec 17, 2011 3:36:08 AMlinkLatest 10 Fiddles :
Event keys java
21guest172.70.216.118vlu4qqJan 8, 2025 2:44:03 PMlinkEvent keys java
20guest172.70.57.218vlu4qqJan 8, 2025 2:21:32 PMlinkEvent keys java
19guest172.70.57.219vlu4qqJan 8, 2025 2:10:39 PMlinktestSplit
7guest172.69.195.1612fql387Jan 8, 2025 9:33:17 AMlinkDate Range
55guest172.71.186.1971rd7sdhJan 8, 2025 7:03:30 AMlinkmenupopup example
1guest172.70.216.166d9vcfJan 7, 2025 12:39:10 PMlinknested grid detail mvvm
1guest172.71.158.237puu6hlJan 7, 2025 3:28:45 AMlinknested grid detail mvvm
1guest172.71.158.2373ot90vpJan 7, 2025 3:26:38 AMlinknested grid detail mvvm
28guest172.71.158.23635slue2Jan 7, 2025 3:24:59 AMlinknested grid detail mvvm
1guest172.71.158.237jtfv38Jan 7, 2025 3:23:33 AMlinknested grid detail mvvm
1guest172.71.158.2373ot90vpJan 7, 2025 3:26:38 AMlinkresources
index.zulzul<div viewModel="@id('vm') @init('pkg$.NestedGridsDetailViewmodel')" height="100%">
<apply template="gridTemplate" gridModel="@load(vm.mainModel)"></apply>
<template name="gridTemplate">
<grid vflex="min" model="@load(gridModel)">
<columns>
<column label="Column1" width="150px"/>
<column label="Column2" hflex="1" />
</columns>
<!-- template for group -->
<template name="model:group">
<group label="@load(each.group)" open="false"/>
</template>
<!-- template for each element in main model -->
<template name="model">
<apply template='@init(each.leaf?"leaf":"detail")'>
<template name="detail">
<row>
<label value="@init(each.label)"/>
<detail open="false">
<apply template="gridTemplate" gridModel="@init(each.nestedModel)"/>
</detail>
</row>
</template>
<template name="leaf">
<row>
<label value="@load(each.label)" />
<label value="@load(each.group)" />
</row>
</template>
</apply>
</template>
<!-- template for footer -->
<template name="model:groupfoot">
<groupfoot>
<cell>
<label value="@load(each)" style="font-weight:bold;" />
</cell>
</groupfoot>
</template>
</grid>
</template>
</div>NestedGridsDetailViewmodel.javajavaimport org.zkoss.bind.annotation.Init;
public class NestedGridsDetailViewmodel {
private DetailsGroupModel mainModel;
@Init
public void init() {
GroupItemComparator groupItemComparator = new GroupItemComparator();
GroupItemData[] nestedData1 = new GroupItemData[]{
new GroupItemData(null, "item 1-1-1-1", "group1-1"),
new GroupItemData(null, "item 1-1-1-2", "group1-1"),
new GroupItemData(null, "item 1-1-2-1", "group1-2")
};
DetailsGroupModel nestedModel1 = new DetailsGroupModel(nestedData1, groupItemComparator);
GroupItemData[] nestedData2 = new GroupItemData[]{
new GroupItemData(null, "item 1-2-1-1", "group1-1"),
new GroupItemData(null, "item 1-2-1-2", "group1-1"),
new GroupItemData(null, "item 1-2-2-1", "group1-2")
};
DetailsGroupModel nestedModel2 = new DetailsGroupModel(nestedData2, groupItemComparator);
GroupItemData[] nestedData3 = new GroupItemData[]{
new GroupItemData(null, "item 1-3-1-1", "group1-1"),
new GroupItemData(null, "item 1-3-1-2", "group1-1"),
new GroupItemData(null, "item 1-3-2-1", "group1-2")
};
DetailsGroupModel nestedModel3 = new DetailsGroupModel(nestedData3, groupItemComparator);
GroupItemData[] nestedData4 = new GroupItemData[]{
new GroupItemData(null, "item 2-1-1-1", "group1-1"),
new GroupItemData(null, "item 2-1-1-2", "group1-1"),
new GroupItemData(null, "item 2-1-2-1", "group1-2")
};
DetailsGroupModel nestedModel4 = new DetailsGroupModel(nestedData4, groupItemComparator);
GroupItemData[] nestedData5 = new GroupItemData[]{
new GroupItemData(null, "item 2-2-1-1", "group1-1"),
new GroupItemData(null, "item 2-2-1-2", "group1-1"),
new GroupItemData(null, "item 2-2-2-1", "group1-2")
};
DetailsGroupModel nestedModel5 = new DetailsGroupModel(nestedData5, groupItemComparator);
GroupItemData[] nestedData6 = new GroupItemData[]{
new GroupItemData(null, "item 3-1-1-1", "group1-1"),
new GroupItemData(null, "item 3-1-1-2", "group1-1"),
new GroupItemData(null, "item 3-1-2-1", "group1-2")
};
DetailsGroupModel nestedModel6 = new DetailsGroupModel(nestedData6, groupItemComparator);
GroupItemData[] nestedData7 = new GroupItemData[]{
new GroupItemData(null, "item 3-2-1-1", "group1-1"),
new GroupItemData(null, "item 3-2-1-2", "group1-1"),
new GroupItemData(null, "item 3-2-2-1", "group1-2")
};
DetailsGroupModel nestedModel7 = new DetailsGroupModel(nestedData7, groupItemComparator);
GroupItemData[] nestedData8 = new GroupItemData[]{
new GroupItemData(null, "item 3-3-1-1", "group1-1"),
new GroupItemData(null, "item 3-3-1-2", "group1-1"),
new GroupItemData(null, "item 3-3-2-1", "group1-2")
};
DetailsGroupModel nestedModel8 = new DetailsGroupModel(nestedData8, groupItemComparator);
GroupItemData[] nestedData9 = new GroupItemData[]{
new GroupItemData(null, "item 3-4-1-1", "group1-1"),
new GroupItemData(null, "item 3-4-1-2", "group1-1"),
new GroupItemData(null, "item 3-4-2-1", "group1-2")
};
DetailsGroupModel nestedModel9 = new DetailsGroupModel(nestedData9, groupItemComparator);
GroupItemData[] mainData = new GroupItemData[]{
new GroupItemData(nestedModel1, "item 1-1", "group1"),
new GroupItemData(nestedModel2, "item 1-2", "group1"),
new GroupItemData(nestedModel3, "item 1-3", "group1"),
new GroupItemData(nestedModel4, "item 2-1", "group2"),
new GroupItemData(nestedModel5, "item 2-2", "group2"),
new GroupItemData(nestedModel6, "item 3-1", "group3"),
new GroupItemData(nestedModel7, "item 3-2", "group3"),
new GroupItemData(nestedModel8, "item 3-3", "group3"),
};
mainModel = new DetailsGroupModel(mainData, groupItemComparator);
}
public DetailsGroupModel getMainModel() {
return mainModel;
}
public void setMainModel(DetailsGroupModel mainModel) {
this.mainModel = mainModel;
}
}
GroupItemComparator.javajavaimport java.io.Serializable;
import java.util.Comparator;
import org.zkoss.zul.GroupComparator;
public class GroupItemComparator implements Comparator<GroupItemData>, GroupComparator<GroupItemData>, Serializable {
// order the items inside of a group
@Override
public int compare(GroupItemData o1, GroupItemData o2) {
return o1.getLabel().compareTo(o2.getLabel());
}
// checks if the items are part of the same group
@Override
public int compareGroup(GroupItemData o1, GroupItemData o2) {
return o1.getGroup().compareTo(o2.getGroup());
}
}
GroupItemData.javajavapublic class GroupItemData {
private DetailsGroupModel nestedModel;
private String label;
private String group;
public DetailsGroupModel getNestedModel() {
return nestedModel;
}
public void setNestedModel(DetailsGroupModel nestedModel) {
this.nestedModel = nestedModel;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getGroup() {
return group;
}
public void setGroup(String group) {
this.group = group;
}
public boolean isLeaf() {
return nestedModel == null;
}
public GroupItemData(DetailsGroupModel nestedModel, String label, String group) {
super();
this.nestedModel = nestedModel;
this.label = label;
this.group = group;
}
}
DetailsGroupModel.javajavaimport java.util.Comparator;
import org.zkoss.zul.GroupsModelArray;
public class DetailsGroupModel extends GroupsModelArray<GroupItemData, GroupItemData, GroupItemData, GroupItemData> {
public DetailsGroupModel(GroupItemData[] data, Comparator<GroupItemData> cmpr, int col, boolean clone) {
super(data, cmpr, col, clone);
}
public DetailsGroupModel(GroupItemData[] data, Comparator<GroupItemData> cmpr, int col) {
super(data, cmpr, col);
}
public DetailsGroupModel(GroupItemData[] data, Comparator<GroupItemData> cmpr) {
super(data, cmpr);
}
}