Grid problem: can't select rows with the mouse
Hi!
I've got a problem with highlighting a row by clicking on it. When I use the following code to enter my data from a database into the grid, it works:
When I use the following code, I can't highlight a row by clicking on it! I have to use the keyboard instead:
This is the rest of my code:
I've got a problem with highlighting a row by clicking on it. When I use the following code to enter my data from a database into the grid, it works:
var myData = [
['data from database'],
['data from database'],
etc.
],
When I use the following code, I can't highlight a row by clicking on it! I have to use the keyboard instead:
var myData = [];
myData['rowID']= [
['data from database']
This is the rest of my code:
// 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');
}
Laurens
February 3,