0

fulfill attribute and live grid grouping

asked 2009-12-24 07:53:56 +0800

tAft gravatar image tAft
36 1

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>



Now, I want to implement fulfill in a live rowRenderer with the next example. Is it possible?
The reason is that my application have groups with lot of rows,and I don't to draw the invisible rows until the user open the group to speedup the display of the page on IE.
I could use paging mold but my project manager want all in one page.
<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>


Thank you for help.

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2017-10-31 18:25:05 +0800

Binay gravatar image Binay
1 1

Hello All,

I am also facing the same issue, like I want to defer the rendering dynamically.

How to do that. I have groupbox, I want to render groupbox data dynamically.

Thanks

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-12-24 07:53:56 +0800

Seen: 1,024 times

Last updated: Nov 01 '17

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More