3.2.0

How could get Grid's cell datat from script

Now, I insert data into Grid from array of jsp.The Grid is Etidable.Then,How could I get the data on web,and used the data on jsp.
...
<%

    Object[][] data = null;
    String value = "";
    int columnCount = 0;
    int rowCount = 0;
    
    if(request.getAttribute("csvImport") != null){
        data = (Object[][])request.getAttribute("csvImport");
        columnCount = data[0].length;
        rowCount = data.length;
    }
%>
<font size="2" color="#FF0000"></font>
<script>

    var grid = new AW.UI.Grid;
    grid.setId("myGrid");
    <%
        for(int i = 0 ; i < columnCount ; i++){
            for(int j = 0 ; j < rowCount-1 ; j++){
                
    %>
    grid.setCellData("<%=data[j][i]%>",<%=i%>,<%=j%>);
    <%
            }
        }
    %>
    grid.setColumnCount(<%=columnCount%>);
    grid.setRowCount(<%=rowCount%>);
    grid.setSelectorVisible(true);
    grid.setSelectorWidth(50);
    grid.setSelectorText(function(r){return this.getRowPosition(r)+1}); // show row numbers
    grid.setSize(screen.width-100*3, screen.height-250*2);
    grid.setCellEditable(true);
    grid.refresh();
</script>
...
sayNever
November 28,

This topic is archived.

See also:


Back to support forum