Home >Web Front-end >JS Tutorial >Learn common methods of ExtJS Window_extjs

Learn common methods of ExtJS Window_extjs

WBOY
WBOYOriginal
2016-05-16 18:45:201059browse

1. Attribute
plain: Boolean type, true means forced coordination with the background color, the default value is false.
resizable: Boolean type, whether the user can resize the form. The default value is true, which means the form can be resized.
maxinizable: Boolean type, true means displaying the maximize button, the default value is false.
maximized: Boolean type, true means to maximize the form when displaying the form, the default value is false.
closable: Boolean type, true means displaying the close button, the default value is true.
bodyStyle: spacing from the border, such as: bodyStyle: "padding:3px".
buttonAlign: the alignment of the button in the form (left, center, right), the default value is right.
closeAction: "close" releases the memory occupied by the form, "hide" hides the form, it is recommended to use "hide".

2. Method
show: Open the form.
hide: Hide the form.
close: Close the form.

3. Events
show: The method is violated when opening the form.
hide: This method is violated when hiding the form.
close: This method is triggered when closing the form.

4. Application examples

Copy code The code is as follows:

Ext. onReady(function(){
var _window=new Ext.Window({
title:"Login",
renderTo:Ext.getBody(),
frame:true,
plain: true,
resizable:false,
buttonAlign:"right",
closeAction:"hide",
maximizable:true,
closable:true,
bodyStyle:"padding:4px ",
width:310,
height:230,
layout:"form",
lableWidth:45,
defaults:{xtype:"textfield",width:180},
items:[{fieldLabel:"Account"},{fieldLabel:"Password"}],
buttons:[{text:"OK"},{text:"Cancel",handler:function(){_window .hide();}}],
listeners:{
"show":function(){
alert("show");
},
"hide":function( ){
alert("Hide");
},
"close":function(){
alert("Close");
}
}
} )
_window.show();
})
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn