Ext JS中Button按钮的显示,以及按钮的部分事件
一、属性
renderTo:将当前对象所生成的HTML对象存放在指定的对象中
text:得到按钮名称
minWidth:按钮最小宽度
hidden:按钮的隐藏或显示(true
or false)
二、构造参数
handler:指定一个函数句柄,在默认事件触发时调用,此时在默认事件为click
listeners:在对象初始化之前,将一系列事件进行绑定。
三、函数
getBogy():对到Body对象
onReady():当页面加载完成时执行本函数
getText():得到按钮名称
setText("按钮名称"):设置按钮名称
源码如下:
<html>
<head>
<meta charset="utf-8" />
<Link href="ext/resources/css/ext-all.css" rel="Stylesheet" type="text/css" />
<script type="text/javascript" src="ext/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
Ext.create("Ext.Button",{
text:"点 击",
renderTo:Ext.getBody(),
listeners:{"click":function(){
alert(this.getText());
}}
})
})
</script>
<style type="text/css">
</style>
</head>
<body>
</body>
</html>
Ext JS中Button的一般使用,布布扣,bubuko.com
原文:http://www.cnblogs.com/dolphin-gjh/p/3568723.html