sencha table

来源:互联网 发布:淘宝怎样换货 编辑:程序博客网 时间:2024/05/17 02:24

开始学的sencha的第一个例子。


在iOS中其实就是一个简单的tableview自定义一下cell,在sencha中也是一样,只是方式有一些差别而已,

Ext.define('senchaTest.view.Profiles', {
extend: 'Ext.List',
xtype: 'Profiles',
config: {
title: 'Profile Name',
ui: 'round',
// grouped: true,
margin : '10 15 10 15',
cls : 'list2',
// itemHeight: 150,
itemCls : 'list2_item',
itemTpl: ['<div id="Design"><h1 style="font-weight:bold;"><span style="float:left;">Customer Name</span><span style="margin-left:30px;">Current</span></h1></div>',
'<p style="margin:-10px 10px 0 0 ; float:right"><button class="mylistdeleteButton">delete</button></p>',
        '<p><img width="17" height="26" src="resources/icons/icon_phone.png" align="absmiddle" /><span style="color:#999; margin-left:5px">{phoneNum}</span><span style="color:blue;margin-left:20px;">{current}</span></p>',
        '<p style="margin:-10px 10px 0 0; float:right"><button class="mylisteditButton">edit</button></p>',
'<p style="color: #999"><img width="23" height="18" src="resources/icons/icon_email.png" align="absmiddle" /><span style="color:#999; margin-left:5px">{email}</span></p>'],
style: { 
'border-radius': '10px'
},


        store: 'Profile'
}
});

list 是sencha的常用控件,itemTpl就是cell,数据要用到sencha中的module及store,用来储存数据,很简单,其他主要是一些css的应用象itemCls/cls。

其实感觉和ios中控件用起来差不多。

原创粉丝点击