showDialog (left: Number, top: Number, parentWindow: Boolean)
left.. Distance from the left edge (pixels).
top. Distance from the top edge in pixels.
parentWindow. Parent window.
The showDialog method shows a dialog box.
A dialog box is used to display information and (or) get user response. Unlike a standard window, a dialog box cannot be collapsed or expanded.
If method parameters are not defined the dialog box is displayed at the center.
To execute the example, connect the PP.js components library and the PP.css visual styles table. The icon.png file is required. Seebelow Javascript code for creating the Window component displayed as a dialog box.
<script type="text/javascript">
//Create the Window component
var win = new PP.Ui.Window({
ParentNode: document.getElementById("wnd"),
//Title
Caption: "Foresight Analytics Platform",
//Image
CaptionIcon: "icon.png",
//Content
Content: "Dialog Box",
Height: 200,
Width: 350,
});
//Open dialog box
win.showDialog();
</script>
After executing the example the HTML page will contain the following dialog box:
The dialog box is displayed in the center as parameters of the showDialog method are not defined.
See also: