.aw-gecko .aw-popup-window .aw-ui-list {
display: block; /* fixes list overflow problem */
}
.aw-ie .aw-templates-combo {
padding: 0px;
}
.aw-ie .aw-templates-combo .aw-item-box {
padding: 1px;
}
.aw-gecko .aw-edit-cell {
padding: 0px;
}
.aw-gecko .aw-edit-cell .aw-item-box {
padding: 1px;
overflow: auto; /* fixes missing text cursor in combo template */
}
if (AW.version = 200){
AW.Templates.Combo.create = function(){
AW.Templates.Popup.create.call(this);
var obj = this.prototype;
obj.setAttribute("awx", "combo");
obj.setClass("templates", "combo");
obj.setClass("combo", "box");
var button = new AW.HTML.TABLE;
button.setClass("combo", "button");
button.setAttribute("cellspacing", "0");
button.setEvent("onclick", function(event){
if (this.$owner && this.$owner._cellTemplate){
var combo = this;
this.$owner.setController("popup", {
onCellEditEnding: function(){
try {
if (AW.gecko && combo.$popup) {
var event = combo.raiseEvent.caller.caller.arguments[0];
var range = document.createRange();
range.selectNode(combo.$popup);
return event.target && (range.compareNode(event.target) == 3);
}
}
catch(err){
//
}
},
onCellEditEnded: function(){
combo.hidePopup();
combo = null;
this.setController("popup", {});
}
});
this.raiseEvent("editCurrentCell", event);
}
this.showPopup();
this.getContent("box/text").element().focus();
this.getContent("box/text").element().parentNode.scrollTop = 0;
});
obj.setContent("box/sign", button);
obj.setContent("box/sign/html", "<tr class=\"aw-cb-1\"><td></td></tr><tr class=\"aw-cb-2\"><td> </td></tr><tr class=\"aw-cb-3\"><td></td></tr>");
};
}
var list = new AW.UI.List;
list.setItemText(function(i){return "Item " + i});
list.setItemCount(25);
var obj = new AW.UI.Grid;
obj.setCellData("cell");
obj.setHeaderText("header");
obj.setColumnCount(10);
obj.setRowCount(10);
obj.setCellEditable(true);
obj.setCellTemplate(new AW.Templates.Combo, 1);
obj.setPopupTemplate(list);
document.write(obj);
var data1 = ["Email","Phone","FedEX","USPS"];
var data2 = ["reconciled","unreconciled","hopeless"];
var list1 = new AW.UI.List;
list1.setItemText(data1);
list1.setItemCount(data1.length);
var list2 = new AW.UI.List;
list2.setItemText(data2);
list2.setItemCount(data2.length);
var obj = new AW.UI.Grid;
obj.setCellData("cell");
obj.setHeaderText("header");
obj.setColumnCount(10);
obj.setRowCount(10);
obj.setCellEditable(true);
obj.setCellTemplate(new AW.Templates.Combo, 1);
obj.setCellTemplate(new AW.Templates.Combo, 2);
obj.setPopupTemplate(list1, 1);
obj.setPopupTemplate(list2, 2);
document.write(obj);
<style>
.aw-gecko .aw-popup-window .aw-ui-list {
display: block; /* fixes list overflow problem */
}
.aw-ie .aw-templates-combo {
padding: 0px;
}
.aw-ie .aw-templates-combo .aw-item-box {
padding: 1px;
}
.aw-gecko .aw-edit-cell {
padding: 0px;
}
.aw-gecko .aw-edit-cell .aw-item-box {
padding: 1px;
overflow: auto; /* fixes missing text cursor in combo template */
}
.aw-gecko .aw-popup-window {
z-index: 10000; /* should be above other elements */
}
</style>
This topic is archived.