how to programmatically add colspan in ZK/Zul? -
how set property of colspan in zul framework?
e.g.
tr tr = new tr(); td td = new td(); tr.appendchild(td); td = new td(); tr.appendchild(td);
now, in next row, have set single td within table row through composer cover space of 2 td . how can accomplish this?
<table> <tr> <td> </td/> <td> </td> </tr> <tr> <td colspan="2"> </td> </tr> </table>
in zul not done <table>
, <tr>
, , <td>
tags <grid>
, <row>
, , <cell>
tags. so..
<grid> <columns> <column label="a" /> <column label="b" /> </columns> <rows> <row> <cell> <label value="item 1" /> </cell> <cell> <label value="item 2" /> </cell> </row> <row> <cell colspan="2"> <label value="item 3" /> </cell> </row> </rows> </grid>
from java side, then, becomes easy..
grid grid = new grid(); rows rows = new rows(); rows.setparent(grid); row row1 = new row(); row1.setparent(rows); cell cell1 = new cell(); cell1.setparent(row1); cell1.appendchild(new label("item1")); cell cell2 = new cell(); cell2.setparent(row1); cell2.appendchild(new label("item2")); row row2 = new row(); row2.setparent(rows); cell cell3 = new cell(); cell3.setparent(row2); cell3.appendchild(new label("item3")); cell3.setcolspan(2); // you're looking
please refer (great) zk docs more information.
zk zul
No comments:
Post a Comment