ContactTelPanel =Ext.extend(Ext.Panel, {
//构造方法
constructor : function(config) {
Ext.apply(this, config);//直接把config对象的属性全复制到this对象中
Parent = this.parent;
var me = this;
ContactTelPanel.superclass.constructor.call(this, {//用ContactTelPanel的父类也就是Ext.Panel的构造函数
autoScroll : true,
title : "拨打电话",//设置title,跟这篇文章的主体没关系,不要管他
id : "contacttelpanel",
bodyStyle : "padding: 30px 300px;",
defaults : {//可以为该对象(ContactTelPanel)包含的组件(也就是在items配置选项)设置一些相同属性
layout : "column",
defaults : {
xtype : "button",
width : 50,
height : 25,
style : "margin:4px 15px",
handler : this.press //为每个按钮都添加一个click的事件
},
bodyBorder : false
},
items : [ {//textfield组件
height : 30,
width : 250,
xtype : "textfield",
id : "tf",
style : "margin-bottom:10px"
}, {// 没有xtype就是默认为panel,下面也是,不然就不要纠结了,直接在这里想象成第一行按钮1、按钮2、按钮3
items : [ {
text : "1"
}, {
text : "2"
}, {
text : "3"
} ]
}, {// 这里是按钮4、按钮5、按钮6
items : [ {
text : "4"
}, {
text : "5"
}, {
text : "6"
} ]
}, {// 这里是按钮7、按钮8、按钮9 下同
items : [ {
text : "7"
}, {
text : "8"
}, {
text : "9"
} ]
}, {
items : [ {
text : "*"
}, {
text : "0"
}, {
text : "#"
} ]
}, {
items : [ {
text : "拨打",
}, {
text : "删除",
} ]
} ]
});
},
press : function() {
var text = this.text, textfield = Ext.getDom("tf");
if (/[0-9*#]/.test(text)) {//在textfield中显示所点击按钮的数字
textfield.value += text;
} else if (this.text == "删除") {//删除功能
textfield.value = textfield.value.slice(0, -1);
} else if (this.text == "拨打") {//这个先不要管他
Tel.telcall(textfield.value);
}
}
});
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有