This article from: http://www.cnblogs.com/szytwo/archive/2012/08/28/2659917.html
jquery Code
var $win; $win = $ (' #test-window '). Window ({ title: ' Add course setup Info ', width:820, height:450, Top: ($ (window ). Height ()-820) * 0.5, left : ($ (window). Width ()-() * 0.5, shadow:true, modal:true, iconcls: ' icon- Add ', closed:true, minimizable:false, maximizable:false, collapsible:false}); $win. Window (' Open ');
HTML code
<div id= "Test-window" class= "Easyui-window" title= "Login" style= "width:300px; height:180px; " > <div> Welcome to http://www.my400800.cn </div> <div style= "padding:5px; Text-align: Center; " > <a href= "#" class= "Easyui-linkbutton" icon= "Icon-ok" >Ok</a> <a href= "#" class= " Easyui-linkbutton " icon=" Icon-cancel ">Cancel</a> </div></div>
Attribute and Method description
window needs to be dependent on the following three components: * Drag-and-drop (draggable) * Resizing (resizable) * Panels (panel)
The following is a look at the specific use of window, first of all attributes of properties and Panels (panel) are the same property.
The following is a list of some window-private properties:
| Property name |
type |
Description |
Default Value |
| ZIndex |
Digital |
The Z-index property of the window can be increased by this property. |
9000 |
| Draggable |
Boolean |
Defines whether a window can be dragged |
True |
| Resizable |
Boolean |
Defines whether the window can be changed in size |
True |
| Shadow |
Boolean |
If set to true, the window's shadow is also displayed. |
True |
| Modal |
Boolean |
Defines whether the window is a modal window. |
True |
Window also overrides some of the properties in the panel.
| Property name |
type |
Description |
Default Value |
| Title |
String |
Title Text of the window |
New Window |
| Collapsible |
Boolean |
Defines whether a collapsible definition button is displayed |
True |
| Minimizable |
Boolean |
Define whether to display the Minimize button |
True |
| Maximizable |
Boolean |
Define whether to display the Maximize button |
True |
| Closable |
Boolean |
Define whether the Close button is displayed |
True |
Property
| name |
type |
Description |
Default Value |
| Title |
String |
Caption text displayed on the head of the panel |
Null |
| Iconcls |
String |
A CSS class to display the 16x16 icon in the panel |
Null |
| Width |
Digital |
Set the width of the panel |
Auto |
| Height |
Digital |
Set the height of the panel |
Auto |
| Left |
Digital |
Set the left position of the panel |
Null |
| Top |
Digital |
Set the top position of the panel |
Null |
| Cls |
String |
Add a CSS class to the panel |
Null |
| Headercls |
String |
Add a CSS class to the head of the panel |
Null |
| Bodycls |
String |
Add a CSS class to the panel body |
Null |
| Style |
Object |
Customizing styles for Panels |
{} |
| Fit |
Boolean |
When set to True, the panel size will fit into its parent container. |
False |
| Border |
Boolean |
Define the border of a panel |
True |
| Dosize |
Boolean |
When set to True, panel load creation will be adjusted and re-laid |
True |
| Collapsible |
Boolean |
Defines whether a collapsible definition button is displayed |
False |
| Minimizable |
Boolean |
Define whether to display the Minimize button |
False |
| Maximizable |
Boolean |
Define whether to display the Maximize button |
False |
| Closable |
Boolean |
Define whether the Close button is displayed |
False |
| Tools |
Array |
Custom tools, each tool can contain two properties: Iconcls and Handler |
[] |
| Collapsed |
Boolean |
Define the collapse panel at initialization time |
False |
| Minimized |
Boolean |
Defines the minimized panel at initialization time |
False |
| Maximized |
Boolean |
Defines the maximized panel at initialization time |
False |
| Closed |
Boolean |
Define to close the panel at initialization time |
False |
| Href |
String |
A remote URL loads the data and then displays it in the panel |
Null |
| Loadingmessage |
String |
The information displayed in the panel when remote data is loaded |
Loading ... |
Event
| name |
Parameters |
Description |
| OnLoad |
None |
Triggered when remote data is loaded |
| Onbeforeopen |
None |
Triggered before the panel opens |
| OnOpen |
None |
Triggered when the panel is open |
| Onbeforeclose |
None |
Trigger when panel is closed |
| OnClose |
None |
Triggered when the panel is closed |
| Onbeforedestroy |
None |
Triggered before the panel is destroyed |
| OnDestroy |
None |
Triggered when the panel is closed |
| Onbeforecollpase |
None |
Triggered before the panel folds |
| Oncollapse |
None |
Triggered when the panel is collapsed |
| Onbeforeexpand |
None |
Triggered before the panel expands |
| Onexpand |
None |
Triggered when the panel is expanded |
| OnResize |
width, height |
Width is triggered when the panel is resized: New width height: new heights |
| OnMove |
Left,top |
When the panel moves, the left is triggered: the new top position on position |
| Onmaximize |
None |
Triggered when the window is maximized |
| Onrestore |
None |
Triggered when the window is restored to its original size |
| Onminimize |
None |
Triggered when the window is minimized |
Method
| name |
Parameters |
Description |
| Options |
None |
Returns the Set property value |
| Panel |
None |
Return to Panel Object |
| Header |
None |
Back to Panel Header object |
| Body |
None |
Returns the Panel Body object |
| Settitle |
Title |
Set Panel header title |
| Open |
ForceOpen |
When ForceOpen is set to True, the panel is opened ignoring the Onbeforeopen callback function |
| Close |
Forceclose |
When Forceclose is set to True, the panel is closed ignoring the onbeforeclose callback function |
| Destroy |
Forcedestroy |
When Forcedestroy is set to True, the panel is destroyed ignoring the Onbeforedestroy callback function |
| Refresh |
None |
Refresh panel to load remote data when href value is set |
| Resize |
Options |
Sets the size and layout of the panel, which contains the following properties: Width: The height of the new panel: The heights of the new panel left: The top of the new panel: Upper position of the new panel |
| Move |
Options |
Move the panel to a new location, which contains the following properties: Left: Top of the new panel: position of the new panel |
JQuery Easyui Window Usage