Check documentation for the latest version of dhtmlxSuite show DHTMLX Docs

show

shows the popup

void show(string|number id);
idstring|numberitem id, for radio buttons you should specify [id,value]

Example

// initializes toolbar
var myToolbar = new dhtmlXToolbarObject({
    parent: "parentId",
    icon_path: "../common/imgs/",
    items: [
        {type: "button", id: "open", img: "open.gif"},
        {type: "button", id: "close", img: "close.gif"}
    ]
});
 
// initializes popup
var myPop = new dhtmlXPopup({
    toolbar: myToolbar,
    id: ["open","close"]
});
 
// show popup near specified item
myPop.show("open");
// or
myPop.show("close");

Details

A popup can be shown:

  • near the item with the specified ID, when a popup is attached to a form or toolbar
  • near the specified area for a stand-alone initialization

In the case of the stand-alone initialization:

  • you need to pass x, y, width and height of the area and a popup will be centered near it automatically

params:

  • x - number, x-position of the area
  • y - number, y-position of the area
  • width - number, the width of the area
  • height - number, the height of the area
// initializes popup
var myPop = new dhtmlXPopup();
myPop.attachHTML("I'm a popup near the specified area");
 
// assuming that we have a div and we need to show a popup near it
var myArea = document.getElementById("myArea");
 
// collect coordinates and dimensions
var x = window.dhx.absLeft(myArea);
var y = window.dhx.absTop(myArea);
var width = myArea.offsetWidth;
var height = myArea.offsetHeight;
 
// show popup
myPop.show(x, y, width, height);
Back to top