当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 学习ExtJS(二) Button常用方法

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 学习ExtJS(二) Button常用方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-10   浏览: 648 ::
收藏到网摘: n/a

ExtJS Button常用方法,需要学习的朋友可以参考下。 一、属性
renderTo:将当前对象所生成的HTML对象存放在指定的对象中
text:得到按钮名称
minWidth:按钮最小宽度
hidden:按钮的隐藏或显示(true or false)
二、构造参数
handler:指定一个函数句柄,在默认事件触发时调用,此时在默认事件为click
listeners:在对象初始化之前,将一系列事件进行绑定。
三、函数
getBogy():对到Body对象
onReady():当页面加载完成时执行本函数
getText():得到按钮名称
setText("按钮名称"):设置按钮名称
四、应用举例
复制代码 代码如下:

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

复制代码 代码如下:

Ext.onReady(function(){
var button= new Ext.Button({
renderTo:Ext.getBody(),
text:"确定"
})
button.on("click",function(){
alert("hello");
})
button.minWidth=200;
button.setText("EasyPass");
})