Hello,
I wen through the samples, I do not see a way to attach popup to menu button
Is there a way to do this?
Please advise
Thanks,
Kris
Hello,
I wen through the samples, I do not see a way to attach popup to menu button
Is there a way to do this?
Please advise
Thanks,
Kris
Hello
You can try something like this:
[code] var toolbar;
var myPop;
function doOnLoad() {
if (!myPop) {
myPop = new dhtmlXPopup();
myPop.attachHTML(“EDIT button was clicked”);
}
myMenu = new dhtmlXMenuObject(“toolbarObj”);
myMenu.setIconsPath("…/common/imgs/");
// initing
myMenu.addNewSibling(null, “file”, “File”, false);
myMenu.addNewSibling(“file”, “edit”, “Edit”, false);
myMenu.attachEvent(“onClick”, function(id, zoneId, cas){
if (id==“edit”) {
showPopup(this)
} else {
hidePopup()
}
});
}
function showPopup(inp) {
if (myPop.isVisible()) {
myPop.hide();
} else {
var x = window.dhx4.absLeft(inp);
var y = window.dhx4.absTop(inp);
var w = inp.offsetWidth;
var h = inp.offsetHeight;
myPop.show(x,y,w,h);
console.log(x, y, w, h);
}
}
function hidePopup() {
if (myPop) myPop.hide();
}[/code]