-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello
I have a problem to implement the fulfill attribute with a RowRenderer. In fact, I don't know how to do and I don't know if it's possible.
If we take the example bellow, we have a grid with groups. Each groups are closed and I add a fulfill attribute on each rows. When we open the group, the rows appears correctly.
<zk> <grid fixedLayout="true"> <columns sizable="true"> <column label="Brand" /> <column label="Processor Type" width="150px"/> <column label="Memory (RAM)" width="120px"/> <column label="Price" width="100px"/> <column label="Hard Drive Capacity" width="150px"/> </columns> <rows> <group label="Dell" open="false" id="Dell"/> <row fulfill="Dell.onOpen"> <label value="Dell E4500 2.2GHz"/> <label value="Intel Core 2 Duo"/> <label value="2GB RAM"/> <label value="$261.00"/> <label value="500GB"/> </row> <row fulfill="Dell.onOpen"> <label value="XP-Pro Slim Dell-Inspiron-530-s"/> <label value="Intel Core 2 Duo"/> <label value="2GB RAM"/> <label value="$498.93"/> <label value="500GB"/> </row> <row fulfill="Dell.onOpen"> <label value="Dell P4 3.2 GHz"/> <label value="Intel Pentium 4"/> <label value="4GB RAM"/> <label value="$377.99"/> <label value="500GB"/> </row> <group label="Compaq" open="false" id="Compaq"/> <row fulfill="Compaq.onOpen"> <label value="Compaq SR5113WM"/> <label value="Intel Core Duo"/> <label value="1GB RAM"/> <label value="$279.00"/> <label value="160GB"/> </row> <row fulfill="Compaq.onOpen"> <label value="Compaq HP XW4200"/> <label value="Intel Pentium 4"/> <label value="4GB RAM"/> <label value="$980"/> <label value="500GB"/> </row> </rows> </grid> </zk>
<zk> class LiveGroupRenderer implements RowRenderer{ public void render(Row row, java.lang.Object data) { if(data instanceof String[]) { String[] ary = (String[]) data; new Label(ary[0]).setParent(row); new Label(ary[1]).setParent(row); new Label(ary[2]).setParent(row); new Label(ary[3]).setParent(row); new Label(ary[4]).setParent(row); } else { Group group=(Group)row; group.setOpen(false); group.setId(data.toString()); new Label(data.toString()).setParent(row); } } } LiveGroupRenderer renderer = new LiveGroupRenderer(); </zscript> <zscript> String[][][] datas = new String[][][]{ new String[][] { new String[]{"Dell E4500 2.2GHz","Intel Core 2 Duo","2GB RAM","$276.00","500GB"}, new String[]{"XP-Pro Slim Dell-Inspiron-530-s","Intel Core 2 Duo","2GB RAM","$498.93","500GB"}, new String[]{"Dell P4 3.2 GHz","Intel Pentium 4","4GB RAM","$377.99","500GB"}, }, new String[][] { new String[]{"Compaq SR5113WM","Intel Core Duo","1GB RAM","$261.00","160GB"}, new String[]{"Compaq HP XW4200","Intel Pentium 4","4GB RAM","$980","500GB"}, } }; GroupsModel model = new SimpleGroupsModel(datas,new String[]{"Dell", "Compaq"}); </zscript> <grid id="lb1" fixedLayout="true" model="${model}" rowRenderer="${renderer}"> <columns sizable="true"> <column label="Brand" /> <column label="Processor Type" width="150px"/> <column label="Memory (RAM)" width="120px"/> <column label="Price" width="100px"/> <column label="Hard Drive Capacity" width="150px"/> </columns> </grid> </zk>
Asked: 2009-12-24 07:53:56 +0800
Seen: 1,024 times
Last updated: Nov 01 '17