-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I need an example of implementation a grid with javascript. Is it posible?
I'm developing a financial web. I need to show market information every 250ms, so I need to process the information in client side.
In my case. I've an array of objects in javascript and I want to add every row to a grid.
For example:
<script type="text/javascript">
function StockItem(quote, name) {
this.Quote = quote;
this.Name = name;
}
var newSt = new StockItem("1", "Test");
<script type="text/javascript">
I want to add a row with newSt
You could build a grid using native components - check firebug for all the dom elements and styling you need. Then, use jquery to insert the row (tr element). Bear in mind that you wouldn't have paging or sorting in the grid.
ok, I need some help. For example to add a row to this grid? Normaly after row I'll add something like append("<tr><td>row content</td></tr>"). Could you help me?
<zk xmlns:w="http://www.zkoss.org/2005/zk/client" >
<window title="Hello!" width="550px" height="300px" border="normal">
<grid id="g" width="200px" >
<columns id="cols">
<column id="col1">column1</column>
<column id="col2">column2</column>
</columns>
<rows id="rows">
<zscript>
String[] x = new String[1];
</zscript>
<row forEach="${x}">
<label value="x${forEachStatus.index}"></label>
<label value="y${forEachStatus.index}"></label>
</row>
</rows>
</grid>
<script type="text/javascript">
function addRow(){
var row = zk.Widget.$('$rows')
}
</script>
</window>
<button label="addRow" w:onClick='addRow()'></button>
</zk>
Hi,
Your using a regular ZK component, not a native one. See here: :http://books.zkoss.org/wiki/ZK_Developer%27s_Reference/UI_Patterns/HTML_Tags/The_native_Namespace
Asked: 2012-02-19 19:32:13 +0800
Seen: 136 times
Last updated: Feb 20 '12