:: Forum >>

How to give Dymnamic array list to grid

I am retriving one arry list from database to jsp now how to assign that array list to grid.
rajesh
Tuesday, October 7, 2008
who
is doing this?
Thursday, December 18, 2008
This can be a solution:

<script>
var cellsArray = new Array();
var headers = ["Attribute"];
var objG = new AW.UI.Grid;
objG.setSize(400, 100);

<%for(int i=0; i<arrayList.size(); i++){%>
cellsArray[<%=i%>] = new Array("<%=arrayList.get(i).attribute%>");
<%}%>


objG.setCellText(cellsArray);
objG.setHeaderText(headers);

objG.setColumnCount(headers.length);
objG.setRowCount(cellsArray.length);

document.write(objG);
</script>

Hope it helps!
Julian
Thursday, January 29, 2009

This topic is archived.


Back to support forum

Forum search