首页 技术 正文
技术 2022年11月21日
0 收藏 584 点赞 4,863 浏览 991 个字

js如下:

 Ext.define('app.view.message.Info', {
alternateClassName: 'messageInfo',
extend: 'Ext.Container',
xtype: 'messageInfo',
config: {
cls: 'info',
scrollable: {
direction: 'vertical',
directionLock: true,
indicators: false
},
tpl: new Ext.XTemplate(
'<div class="title tl">{Title}</div>',
'<div class="box sm"><div class="left">时间 {Time}</div><div>发布来源:{Auth}</div></div>',
'<div class="box"><div class="one"></div><div>',
'<div class="x-button btn"><span class="x-button-icon shareIco x-icon-mask" doit="11"></span></div>',
'<div class="x-button btn"><span class="x-button-icon favorites x-icon-mask"></span></div>',
'<div class="x-button btn"><span class="x-button-icon commentIco x-icon-mask"></span></div>',
'</div></div>',
'<div class="con">{Summary}</div>')
},
/*初始化*/
initialize: function () {
this.callParent();
//添加按钮监控
this.element.on({
tap: 'onBtnTab',//点击后激活方法
delegate: 'div.x-button', //这里是指div中class为x-button的对象
scope: this
});
},
onBtnTab: function (e, span) {
//获取所需参数
var name = span.getAttribute("doit");
console.log(name);
}
});

界面效果如图,其中的按钮是利用tpl来实现的

sencha touch  tpl 实现按钮功能

css布局略过

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,999
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,511
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,357
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,140
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,770
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,848