JavaXT
|
|||||||||||||
Window ClassWindow control that can be used to create dialogs, alerts, etc. The window consists of a header, body, footer, and mask.
Here's a simple example of how to instantiate a resizable window: var window = new javaxt.dhtml.Window(document.body, { title: "Window Test", width: 400, height: 200, modal: false, resizable: true });Once the window is instantiated you can call any of the public methods. You can also add event listeners by overriding any of the public "on" or "before" methods like this: window.open(); window.onResize = function(){ console.log(window.getWidth(), window.getHeight()); }; ConstructorsUsed to instantiate this class
Config Optionstitle DOM element or string rendered in the header. Note that this config is optional and can be set after the Window has been instantiated. See setTitle().
body DOM element or string rendered in the body. Note that this config is optional and can be set after the Window has been instantiated. See setBody().
footer DOM element or string rendered in the footer. Note that this config is optional and can be set after the Window has been instantiated. See setFooter().
buttons Buttons to put in the footer. Only rendered if no "footer" config is defined. Example:
buttons: [ { name: "OK", onclick: function(){ win.close(); } } ] modal If true, will render a mask directly behind the window to prevent users from interacting with any other part of the window's parent. Default is false.
resizable If true, users can resize the window using resize handles along the border of the window. Default is true.
closable If true, will add a button to the header that will close the window when clicked. Default is true.
movable If true, will allow users to move the window around by dragging the window header. Default is true.
shrinkToFit If true, will resize window if it is larger that the parent. Default is false.
valign Vertical align hint used when rendering the window. Options include "top" and "middle" (default).
style Style for individual elements within the component. Note that you can provide CSS class names instead of individual style definitions.
renderers
EventsPublic MethodssetBody( obj ) Used to update/replace window's body (main content panel)
showAt( x, y, animation ) Used to make the window visible at a given location on the screen. close( silent ) Used to close/hide the window
setWidth( width ) Used to set the width of the window
setHeight( height ) Used to set the height of the window
update( ) Used to update the size of the window. Called internally whenever the window is resized to insure that the window contents fit inside the window. If you are updating DOM elements within the window dynamically, you may need to call this method. |