var combo = new AW.Templates.Combo;
grid.setCellTemplate(combo, 3);
for (var row = 0; row < grid.getRowCount(); row++)
{
grid.getCellTemplate(3, row).setAttribute("expanded", false);
}
grid.onCellClicked =
function(event, col, row)
{
if (col == 3)
{
var cellTemplate = this.getCellTemplate(col, row);
if ((cellTemplate.getAttribute("expanded") == null) ||
(cellTemplate.getAttribute("expanded") == false))
{
cellTemplate.setAttribute("expanded", true);
cellTemplate.showPopup();
}
else
{
cellTemplate.hidePopup();
cellTemplate.setAttribute("expanded", false);
}
}
return true;
};
grid.setPopupTemplate(
function(col, row)
{
var grid = this;
var list = new AW.UI.List;
list.setSelectionMode('single');
list.setItemValue(myValues[row]);
list.setItemText(myNames[row]);
list.setItemCount(myValues[row].length);
list.setSelectedItems([selectedRows[row]]);
list.setControlText(myNames[row][selectedRows[row]]);
list.onItemClicked =
function(event, i)
{
this.setSelectedItems([i]);
var value = this.getItemValue(i);
var text = this.getItemText(i);
grid.setCellValue(value, col, row);
grid.setCellText(text, col, row);
grid.getCellTemplate(col, row).hidePopup();
grid.getCellTemplate(col, row).setAttribute("expanded", false);
selectedRows[row] = i;
selectRow(row, (row+1));
};
if (row % 2 == 1)
{
list.setStyle("background-color", "<%=alternateColor%>");
}
list.setStyle("width", "100%");
return list;
});
This topic is archived.