0

Dynamic grid with rowspan attribute

asked 2012-01-26 16:32:05 +0800

carpolva gravatar image carpolva
155 4

Hi guys.

I have the following manually developed grid:

                  <grid width="550px">
		        <auxhead>
		            <auxheader colspan="6" label="Indicator" />
		        </auxhead>
		        <auxhead>
		            <auxheader colspan="2" label="" />
		            <auxheader colspan="2" label="Monday" />
		            <auxheader colspan="2" label="Tuesday" />
		        </auxhead>
		        <columns>
		            <column width="100px">User</column>
		            <column width="50px"></column>
		            <column width="100px">Indicator 1</column>
		            <column width="100px">Indicator 2</column>
		            <column width="100px">Indicator 1</column>
		            <column width="100px">Indicator 2</column>
		        </columns>
		        <rows>
		            <row id="ryuRow1">
		            	<cell rowspan="2">
		        			<label value="Ryu Hayabusa" />
		    			</cell>
		                <label value="%" />
		                <label value="85%" />
		                <label value="86%" />
		                <label value="87%" />
		                <label value="88%" />
		            </row>
		            <row id="ryuRow2">
		                <label value="hours" />
		                <label value="7.5" />
		                <label value="7.6" />
		                <label value="7.7" />
		                <label value="7.8" />
		            </row>
		            <row id="shiryuRow1">
		            	<cell rowspan="2">
		        			<label value="Shiryu Lee" />
		    			</cell>
		                <label value="%" />
		                <label value="90%" />
		                <label value="91%" />
		                <label value="92%" />
		                <label value="93%" />
		            </row>
		            <row id="shiryuRow2">
		                <label value="hour" />
		                <label value="9" />
		                <label value="9.1" />
		                <label value="9.2" />
		                <label value="9.3" />
		            </row>
		        </rows>
		    </grid>

Note that it has a cell rowspan attribute (please, if you can, run this grid in a .zul file to see its appearance for a better understanding).

That was easy, the issue is... that I need to develop the same grid but DYNAMICALLY. So, according to my experience the row tag must be like this (with a previous implemented grid model of course):

                <row self="@{each='item'}">
                    <label  value="@{item.value1}"/>
                    <label value="@{item.value2}"/>
                </row>

That dynamic way describes the behaviour of each grid row, but, with a rowspan attribute I don´t know how to use it (in the manual grid, the data for "Ryu Hayabusa" is composed by two rows -ryuRow1 and ryuRow2-, it applies for every user).

I really appreciate any help.

Regards.

delete flag offensive retag edit

1 Reply

Sort by » oldest newest

answered 2012-01-26 21:30:07 +0800

carpolva gravatar image carpolva
155 4

Finally I decided to create the grid dynamically in the window composer (Java Class).

For example:

Row row = new Row();
Cell cell = new Cell();
cell.setRowspan(2);

etc etc etc

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: 2012-01-26 16:32:05 +0800

Seen: 267 times

Last updated: Jan 26 '12

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