:: Forum >>

combo in header

i have a series of combo boxes in my header that, when changed, change the text of a cell instead of the combo box. for each box it alters the cell in it's column same row it is in the header...hope that makes sense.

for (var colNumber = 0; colNumber < 5; colNumber++) {
var template = new AW.UI.List;
template.setItemText([colNumber,"is "," a ", "test"]);
template.setControlText("abc");
template.setItemCount(4);

table.setHeaderTemplate(new AW.Templates.Combo,colNumber, 2); /*this is where i think the error comes in */
table.setPopupTemplate(template, colNumber);
template.setAttribute("aw", "control");
    }
    
    template.onItemClicked = function(event, i){
var text = this.getItemText(i);
table.setHeaderText(text, col, row);
table.setCellValue(text, col, row);
table.getHeaderTemplate(col, row).hidePopup();
}


any ideas would be a great help.
Ryan Garabedian
Thursday, July 17, 2008
here is a repost, not sure what went wrong there....

for (var colNumber = 0; colNumber < 5; colNumber++) {
var template = new AW.UI.List;
template.setItemText([colNumber,"is "," a ", "test"]);
template.setControlText("abc");
template.setItemCount(4);

table.setHeaderTemplate(new AW.Templates.Combo,colNumber, 2);
table.setPopupTemplate(template, colNumber);
template.setAttribute("aw", "control");
}

template.onItemClicked = function(event, i){
var text = this.getItemText(i);
table.setHeaderText(text, col, row);
table.setCellValue(text, col, row);
table.getHeaderTemplate(col, row).hidePopup();
}
Ryan Garabedian
Thursday, July 17, 2008
In grid headers it is better to use AW.UI.Combo class (separate instance for each header cell instead of single template). Please check the sample code in \examples\grid elements - headers\combo.htm
Alex (ActiveWidgets)
Friday, July 18, 2008

This topic is archived.


Back to support forum

Forum search