3.2.0

Can not get value(key) of grid cell that is combobox??

var obj = new AW.UI.Grid;
obj.setCellData(function(col, row){return col + "." + row});
obj.setHeaderText("header");

obj.setColumnCount(10);
obj.setRowCount(10);

// new cell property hides/shows indicator sign
obj.defineCellProperty("indicator", false);

// show for cell 1-1
//obj.setCellIndicator(true, 1,1);
// show for column 1
obj.setCellIndicator(true, 1);
obj.setCellIndicator(true, 2);

// our new template for col-1
obj.setCellTemplate(new MyTemplate, 1);
obj.setCellTemplate(new MyTemplate, 2);

obj.setCellTemplate(new AW.Templates.Combo, 0);
obj.setStyle("width", "800px;");
obj.setCellTemplate(new AW.Templates.Checkbox, 3);
var myItems = ["item11", "item12", "item13", "item14"];
var myItemsV = ["a", "b", "d", "f"];
obj.setPopupTemplate();
obj.setPopupTemplate(function(col, row){

var list = new AW.UI.List;
list.setItemText(myItems);
list.setItemValue(myItemsV);
list.setItemCount(myItems.length);
list.setStyle("width", "200px;");
//list.setStyle("height", "50px;");

list.onItemClicked = function(event, i){
var selectedText = this.getItemText(i);
obj.setCellText(selectedText, col, row);
obj.setCellValue(selectedText, col, row);
obj.getCellTemplate(col, row).hidePopup();
alert(obj.getCellValue(col, row));//problem here(alway show display text(ex:item11,item12 ....) I want display a , b, d ...
}
return list;
});

obj.onCellIndicatorClicked = function(event, col, row){
//alert("Cell indicator - " + col + " " + row);
alert(obj.getCellText(col-1, row));
};

document.write(obj);
Nguyen Van Thai
September 1,
list.onItemClicked = function(event, i){
var selectedText = this.getItemText(i);
var selectedValue = this.getItemValue(i);
obj.setCellText(selectedText, col, row);
obj.setCellValue(selectedValue, col, row);
obj.getCellTemplate(col, row).hidePopup();
alert(obj.getCellValue(col, row));//problem here(alway show display text(ex:item11,item12 ....) I want display a , b, d ...
}
return list;
});
September 1,

This topic is archived.

See also:


Back to support forum