:: Forum >>
Load Grid Question
I'm really new to Javascript and Activewidgets.
I'm loading a grid with a array using for example:
var myCells = [
["MSFT","Microsoft Corporation", "314,571.156", "32,187.000"],
["ORCL", "Oracle Corporation", "62,615.266", "9,519.000"],
["SAP", "SAP AG (ADR)", "40,986.328", "8,296.420"],
["CA", "Computer Associates Inter", "15,606.335", "3,164.000"],
["ERTS", "Electronic Arts Inc.", "14,490.895", "2,503.727"]
];
The grid is displaying fine. I have a button on a JSP page that makes a
AW.HTTP.Request(request()) call which does some updating on the server side and should refresh the grid when complete.
I'm confused on how to update "myCells" variable. The grid is not displaying the updated results since myCells was not updated. I do not want to submit the page. Can someone please point me in the right direction or let me know if this is not possible. Thanks in advance.
Below is sample code.
<script>
// grid data in javascript array
var myCells = [
["MSFT","Microsoft Corporation", "314,571.156", "32,187.000"],
["ORCL", "Oracle Corporation", "62,615.266", "9,519.000"],
["SAP", "SAP AG (ADR)", "40,986.328", "8,296.420"],
["CA", "Computer Associates Inter", "15,606.335", "3,164.000"],
["ERTS", "Electronic Arts Inc.", "14,490.895", "2,503.727"]
];
// create new grid object
var obj = new AW.UI.Grid;
// assign reference to the data array
obj.setCellData(myCells);
// set number of columns/rows
obj.setColumnCount(4);
obj.setRowCount(5);
// write the grid to the page
document.write(obj);
</script>
Jack
Tuesday, August 8, 2006
Jack, is exactly my problem. My case, instead array, i is using AW.XML.Table;
sample:
btn0.onClick= function()
{
var r = new AW.HTTP.Request;
r.setURL("empresa.php");
r.setRequestMethod("GET");
r.setParameter("pFilter", input.getControlText());
r.setParameter("pXml", input.getControlText());
r.request();
r.response = function(data)
{
var numRow = this.getResponseXML().getElementsByTagName("company").length;
table.setXML(data);
obj.setRowCount(numRow);
obj.setCellModel(table);
obj.refresh();
}
}
Anderson, Brazil
Friday, August 11, 2006
This topic is archived.
Back to support forum
Forum search