var objGrid = new AW.UI.Grid;
var dataRowArray = new Array();
var colnames = new Array(20);
var columnCount;
//ATTACH EVENTS TO OBJECT
objGrid.onRowAdded = function(row){setRowData(this);};
//FUNCTION DEFINITIONS
function initGridControl()
{
var num = new AW.Formats.Number;
num.setTextFormat("#,###.");
dataRowArray = new Array(columnCount);
//colnames = new Array(columnCount);
objGrid.setSize(850, 300);
objGrid.setId("Worklistview");
objGrid.setHeaderText(colnames);
objGrid.setCellFormat(num, 2);
objGrid.setColumnCount(columnCount);
objGrid.setRowCount(0);
objGrid.setRowHeight(25);
objGrid.setCellEditable(false);
//Set selecter column
objGrid.setSelectorVisible(false);
objGrid.setSelectorText("*");
objGrid.setSelectorWidth(28);
objGrid.setHeaderHeight(20);
//objGrid.setSelectionMode(true);
objGrid.setSelectionMode("single-row");
document.write(objGrid); //Display object on browser
objGrid.refresh();
}
function addRecord(recordData)
{
dataRowArray = recordData;
objGrid.addRow(objGrid.getRowCount());
}
function setRowData(newRowHandle)
{
try
{
//newRowHandle.setCellData(dataRowArray);
//newRowHandle.setCellText(dataRowArray, objGrid.getRowCount() - 1, newRowHandle);
newRowHandle.setCellText(dataRowArray, objGrid.getRowCount() - 1);
}
catch(e)
{
alert('Error : ' + e.description);
}
}
var objGrid = new AW.UI.Grid;
var dataRowArray = new Array();
//ATTACH EVENTS TO OBJECT
objGrid.onRowAdded = function(row){setRowData(this);};
//FUNCTION DEFINITIONS
function initGridControl()
{
var FORMAT_NUMBER = new AW.Formats.Number;
var FORMAT_STRING = new AW.Formats.String;
var FORMAT_DATE = new AW.Formats.Date;
var headerRowArray = ["Rank", "Country", "Internet users", "Data from", "Extension"];
FORMAT_NUMBER.setTextFormat("#,###.##");
FORMAT_DATE.setDataFormat("ISO8601");
FORMAT_DATE.setTextFormat("dd-MMM-yyyy");
objGrid.setSize(850, 550);
objGrid.setId("workList");
objGrid.setHeaderText(headerRowArray);
objGrid.setCellFormat(FORMAT_NUMBER, 2);
objGrid.setColumnCount(5);
objGrid.setRowCount(0);
objGrid.setRowHeight(25);
objGrid.setCellEditable(false);
//Set selecter column
objGrid.setSelectorVisible(false);
objGrid.setSelectorText("*");
objGrid.setSelectorWidth(28);
objGrid.setHeaderHeight(20);
//objGrid.setSelectionMode(true);
objGrid.setSelectionMode("single-row");
document.write(objGrid); //Display object on browser
objGrid.refresh();
}
function addRecordsDynamic()
{
for(var i = 1; i <= 10; i++)
{
for(var j = 1; j <= 5; j++)
{
dataRowArray[j-1] = "Cell_" + i + "-" + j;
}
//alert(dataRowArray);
objGrid.addRow(objGrid.getRowCount());
}
}
function setRowData(newRowHandle)
{
try
{
newRowHandle.setSelectedRows(objGrid.getRowCount() - 1);
newRowHandle.setCellText(dataRowArray, objGrid.getRowCount() - 1);
}
catch(e)
{
alert('Error : ' + e.description);
}
}
This topic is archived.