var myData = [
['data from database'],
['data from database'],
etc.
],
var myData = [];
myData['rowID']= [
['data from database']
// create ActiveWidgets Grid javascript object
var grid = new AW.UI.Grid;
grid.setStyle('width','99.5%')
grid.setStyle('height','350px')
grid.setVirtualMode(false);
// provide cells and headers text
grid.setCellText(myData);
grid.setHeaderText(myColumns);
// yes... this line is correct
grid.setRowIndices([<%=rowlist%>]);
// define data formats
var str = new AW.Formats.String;
var num = new AW.Formats.Number;
var dat = new AW.Formats.Date;
dat.setTextFormat("dd-mm-yyyy")
grid.setCellFormat([str, str, str, str, dat, dat, str, str, str, str]);
// set number of rows/columns (rowcount from database)
grid.setColumnCount(10);
grid.setRowCount(<%=i%>);
// set headers width/height
grid.setHeaderHeight(20);
// set editable on/off
grid.setCellEditable(false);
// enable row selectors
grid.setSelectorVisible(true);
grid.setSelectorWidth(30);
grid.setSelectorText(function(i){return this.getRowPosition(i)+1});
// set row selection
grid.setSelectionMode("single-row");
document.write(grid);
// on click open record
grid.onSelectedRowsChanged = function(row){
nr = grid.getCellValue(1,row)
ajax_details(nr)
tabs.setSelectedItems([0]);
}
// NOTE THAT THIS ALSO DOESN'T WORK!!
grid.onControlClicked = function(event, row){
alert('test');
}
This topic is archived.