学习ExtJS(二) Button常用方法
作者:bea
一、属性 renderTo:将当前对象所生成的HTML对象存放在指定的对象中 text:得到按钮名称 minWidth:按钮最小宽度 hidden:按钮的隐藏或显示(true or false) 二、构造参数 handler:指定一个函数句柄,在默认事件触发时调用,此时在默认事件为click listeners:在对象初始化之前,将一系列事件进行绑定。 三、函数 getBogy():对到Body对象 onReady():当页面加载完成时执行本函数 getText():得到按钮
一、属性
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");
})
有用 | 无用
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");
})
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- js css样式操作代码(批量操作)
- javascript Range对象跨浏览器常用操作
- 防止动态加载JavaScript引起的内存泄漏问题
- JavaScript delete 属性的使用
- 有效的捕获JavaScript焦点的方法小结
- Javascript isArray 数组类型检测函数
- JavaScript 监听textarea中按键事件
- jquery 最简单的属性菜单
- Javascript 日期处理之时区问题
- 学习ExtJS table布局
- 学习ExtJS accordion布局
- 学习ExtJS form布局
- 学习ExtJS fit布局使用说明
- 学习ExtJS border布局
- 学习ExtJS Column布局
- 学习ExtJS 访问容器对象
- 学习ExtJS Window常用方法
- 学习ExtJS Panel常用方法
- 学习ExtJS TextField常用方法