var myData = [my data array here];
var myColumns = [my column headers here];
var currSel = new Array();
function gridClick(src) {
var index = parseInt(obj.getCurrentRow());
if (isNaN(index)) {
return;
}
if (mode == GRID_MODE) {
var ticket_id = myData[index][0];
visited[ticket_id]=true;
common.loadapp(ticket_id);
obj.getRowTemplate(index).setStyle("font-weight","normal");
obj.getRowTemplate(index).setStyle("font-style","italic");
obj.getRowTemplate(index).refresh();
} else { // QUEUE_MODE
visited = keyList;
currSel = obj.getSelectedRows();
ids="";
if (currSel.length>1) {
multiSelect = true ;
} else {
multiSelect = false ;
}
for (c=0;c<currSel.length;c++) {
ticket_id = myData[currSel[c]][0];
keyList[ticket_id] = keyList[ticket_id] ? multiSelect : true ;
obj.getRowTemplate(currSel[c]).setStyle("font-weight","bold");
obj.getRowTemplate(currSel[c]).refresh();
}
setForm();
}
//console.log(currSel);
}
var obj = new AW.UI.Grid;
obj.setId("grid");
//assign header and cell text for aw.js
obj.setCellData(textFunction);
obj.setCellValue(valueFunction);
obj.setHeaderText(myColumns);
//set number of columns/rows for aw.js
obj.setRowCount(myData.length);
obj.setColumnCount(myColumns.length);
obj.setSelectorTemplate(new AW.Templates.CheckedItem);
document.write(obj);
obj.onRowSelectedChanged = function(){gridClick()};
This topic is archived.