3.2.0

Popup menu

Hello,

I would like to have popup menu and it seems to me that it is very similar to AW.UI.ComboBox except with the difference of not updating the comboBox with the selected value.

It seems to be a so simple question that I wonder if someone who would be an expert of this excellent framework could guide me to what I need to customize to obtain what I want.

Regards,

Philippe
Philippe Marzin
October 27,
Finally I did this and it works, however this is not the best menu I have seen...

I took it from the combo.js source and comment out two lines.



AW.UI.Menu = AW.UI.List.subclass();

AW.UI.Menu.create = function(){

AW.UI.ImageText.create.call(this);
AW.UI.Input.create.call(this);

var obj = this.prototype;

obj.setAttribute("aw", "combo");
obj.setClass("ui", "combo");
obj.setClass("text", "");
obj.setContent("html", "");

obj.defineTemplate("popup", new AW.Templates.Popup);

var button = new AW.HTML.TABLE;

button.setClass("item", "combo");
button.setAttribute("cellspacing", "0");

button.setEvent("onclick", function(){
this.getPopupTemplate().show();
});

obj.setContent("box/sign", button);
obj.setContent("box/sign/html", "<tr class=\"aw-cb-1\"><td></td></tr><tr class=\"aw-cb-2\"><td>&nbsp;</td></tr><tr class=\"aw-cb-3\"><td></td></tr>");

obj.onCurrentItemChanged = function(i){
var text = this.getItemText(i);
//this.setControlText(text);
this.timeout(function(){
this.getPopupTemplate().hide();
//this.getContent("box/text").element().value = text;
this.onKeyEnter();
}, 100);
};
};
Philippe Marzin
October 27,

This topic is archived.

See also:


Back to support forum