To add dhtmlxPopup into an application, you need to take the following simple steps:
- Download the Popup package and unpack it into a folder of your project
- Include source files
- Initialize Popup with the object constructor
- Set content into Popup
Create an HTML file and place full paths to JS and CSS files of the dhtmlxSuite library into the header of the file. The files are:
Initialize Popup with the
dhx.Popup object constructor.
// creating dhtmlxPopupvar popup = new dhx.Popup(); popup.show("popup_container");
To show a created popup on a page, you should call the show() method after initialization of the component.
There are several ways of adding content into the dhtmlxPopup:
- by using attachHTML() to attach some HTML content into a popup
var popup = new dhx.Popup();popup.attachHTML("<h1>Hello, I'm popup</h1>");popup.show("popup");
Related sample: Popup. Html Content
- by calling attach() to add other DHTMLX components into a popup
Related sample: Popup. Attach Timepicker