-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I need to read the grid data on the server. I've created a grid with javascript and when I've clicked button on server side the Rows are empty.
How update all data?
<window title="Test Grid" apply="es.composer.Test" > <grid id="grid" width="500px" height="100px"> <columns> <column label="Col1" align="center"/> <column label="Col2" align="center"/> <column label="Col3" align="center"/> </columns> <rows id="rows"> </rows> </grid> <button id="server" label="test"/> <script><![CDATA[ zk.afterMount(function() { var rows = zk.Widget.$('$rows'); var row = new zul.grid.Row(); row.appendChild(new zul.wgt.Label({value: "1"})); row.appendChild(new zul.wgt.Label({value: "2"})); row.appendChild(new zul.wgt.Label({value: "3"})); rows.appendChild(row); }); ]]></script> </window>
What purpose make you use javascript to create <row> and append it to <rows> ?
You might write <row> in zul file directly. Like this:
<grid id="grid" width="500px" height="100px"> <columns> <column label="Col1" align="center"/> <column label="Col2" align="center"/> <column label="Col3" align="center"/> </columns> <rows id="rows"> <row> <label value="1" /> <label value="2" /> <label value="3" /> </row> </rows> </grid>
Asked: 2012-04-26 09:28:27 +0800
Seen: 131 times
Last updated: May 21 '12