<html>
<head>
<script src="runtime/lib/aw.js"></script>
<link href="runtime/styles/xp/aw.css" rel="stylesheet"></link>
</head>
<body>
<script>
var HeaderText = ["Number","Description"];
var CellText = [
["1","Description 1"],
["2","Description 2"],
["3","Description 3"],
["4","Description 4"],
["5","Description 5"]
];
var obj = new AW.UI.Grid;
obj.setHeaderText(HeaderText);
obj.setCellText(CellText);
obj.setColumnCount(2);
obj.setRowCount(5);
// BEGIN COMBO POPUP CODE
rowCombo = new AW.Templates.Combo;
obj.setCellTemplate(rowCombo, 1);
obj.setPopupTemplate(function(col, row){
var grid = this;
var list = new AW.UI.List;
list.setItemText(["text1", "text2", "text3"]);
list.setItemCount(3);
list.onItemClicked = function(event, i){
var text = this.getItemText(i);
grid.setCellText(text, col, row);
grid.setCellValue(text, col, row);
grid.getCellTemplate(col, row).hidePopup();
}
return list;
});
// END COMBO POPUP CODE
document.write(obj);
</script>
</body>
</html>
<script>
var HeaderText = ["Number","Description"];
var CellText = [
["1","Description 1"],
["2","Description 2"],
["3","Description 3"],
["4","Description 4"],
["5","Description 5"]
];
var obj = new AW.UI.Grid;
obj.setHeaderText(HeaderText);
obj.setCellText(CellText);
obj.setColumnCount(2);
obj.setRowCount(5);
obj.setCellEditable(true);
rowCombo = new AW.Templates.Combo;
var list = new AW.UI.List;
list.setItemText(["text1", "text2", "text3"]);
list.setItemCount(3);
obj.onCellTextChanged = function(text,col,row){
if(col==1){
this.setCellValue(text+'-Value',col,row);
}
alert(this.getCellValue(col,row) ) ;
}
obj.setCellTemplate(rowCombo, 1);
obj.setPopupTemplate(list,1);
document.write(obj);
</script>
This topic is archived.