Home > Web Front-end > JS Tutorial > Learning ExtJS (2) Common methods of Button_extjs

Learning ExtJS (2) Common methods of Button_extjs

WBOY
Release: 2016-05-16 18:45:25
Original
992 people have browsed it

1. Attributes
renderTo: Store the HTML object generated by the current object in the specified object
text: Get the button name
minWidth: The minimum width of the button
hidden: Hide or show the button (true or false)
2. Construction parameters
handler: Specify a function handle to be called when the default event is triggered. At this time, the default event is click
listeners: Before the object is initialized, bind a series of events Certainly.
3. Function
getBogy(): to the Body object
onReady(): execute this function when the page is loaded
getText(): get the button name
setText("Button name "): Set button name
4. Application examples

Copy code The code is as follows:

Ext.onReady(function(){
var button= new Ext.Button({
renderTo:Ext.getBody(),
text:"OK",
listeners:{
"click":function()
{
alert("Hello");
}
}
})
button.minWidth=200;
button.setText( "EasyPass");
})

Copy code The code is as follows:

Ext.onReady(function(){
var button= new Ext.Button({
renderTo:Ext.getBody(),
text:"OK"
})
button.on("click",function(){
alert("hello");
})
button.minWidth=200;
button.setText("EasyPass");
})
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template