need to make combobox disabled
Hi,
combobox is in grid, and i want to make combox disabled. means non editable and also combobox should be grey out.
Please help me out.
Thanks,
APP
May 19,
I found this code on this forum:
AW.Templates.xCombo = AW.Templates.ImageText.subclass();
AW.Templates.xCombo.create = function(){
AW.Templates.Popup.create.call(this);
var obj = this.prototype;
obj.isDisabled=false;
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){
var row = this.$owner.getCurrentRow();
var lLocked = this.$owner.getCellValue(3,row);
if (lLocked=="YES"){
return;
}
if ((!this.$owner && !this.$active) || (this.$owner && !this.$owner.$active)) {
return;
}
if (this.$owner && this.$name == "cell"){
this.$owner.startCellEdit();
}
this.showPopup();
});
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>");
AW._addMouseEvents(obj, "combo");
};
To add the combo to the grid I use:
//create the list
var list1 = new AW.UI.List;
list1.setItemText(itemText);
list1.setItemCount(itemCount);
list1.setStyle("width","300");
//add to grid column:
G1.setCellTemplate(new AW.Templates.xCombo, 6);
G1.setPopupTemplate(list1, 6);
hope this helps.
Erik Dobrie
May 19,
Hi Erik,
Thanks for help. but Combobox in grid already working. I want solution on greyout of combobox.
above u didnt mentioned solution for greyout.
it should be Grey Out and disabled.
thanks,
APP
May 20,
I added the above code because I believe creating your own control that can be disabled is the only way to make it work. The default template can not be disabled as far as I know.
Erik Dobrie
May 21,