您的位置:首页 > Web前端 > JavaScript

如何在extjs touch List控件中在item行添加图片

2011-11-02 15:23 585 查看
Ext.setup({
icon: 'icon.png',
glossOnIcon: false,
onReady: function() {

Ext.regModel('Contact', {
fields: ['firstName', 'lastName', 'imgURL']
});

var store = new Ext.data.JsonStore({
model  : 'Contact',
sorters: 'lastName',

getGroupString : function(record) {
return record.get('lastName')[0];
},

data: [
{firstName: 'Tommy',   lastName: 'Maintz',  imgURL:'myImage.png'},
{firstName: 'Rob',     lastName: 'Dougan',  imgURL:'myImage.png'},
{firstName: 'Ed',      lastName: 'Spencer', imgURL:'myImage.pngg'},
{firstName: 'Jamie',   lastName: 'Avins',   imgURL:'myImage.png'},

]
});

var list = new Ext.List({
fullscreen: true,

itemTpl : '<img src="{imgURL}" width="20" heigh="20"></img><span>{firstName} {lastName}</span>',
//grouped : true,
//indexBar: true,

store: store
});
list.show();

}
});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  extjs list function
相关文章推荐