Fix - combo template not closing in Firefox
Combo template popup in AW 2.0.0 does not close if you click outside of the popup. Sorry that it took so much time to correct this - here is the patch.
CSS:
script:
To apply the patch you have to add CSS rules to the end of aw.css and the script to the end of aw.js (or replace AW.Templates.Combo code).
Here is an example using combo template -
CSS:
.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 */
}
script:
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>");
};
}
To apply the patch you have to add CSS rules to the end of aw.css and the script to the end of aw.js (or replace AW.Templates.Combo code).
Here is an example using combo template -
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);
Alex (ActiveWidgets)
April 10,