现在的位置: 首页 > 综合 > 正文

sencha touch 2制作滑动DataView(无缝list)

2013年01月05日 ⁄ 综合 ⁄ 共 631字 ⁄ 字号 评论关闭
Ext.define('App.view.Sections', {
    extend: 'Ext.dataview.DataView',
    xtype: 'sectionslist',
    id: 'mainlist',

    requires: [
        'App.store.Sections',
    ],

    config: {
        store:'Sections' ,

        //itemTpl: '<div>{name} is {id} years old</div>'

        //height: 205,

        scrollable: 'vertical',

        /*  inline: {
         wrap: false
         },*/

        //set the itemtpl to show the fields for the store
        itemTpl: '<div style="text-align: center"><img src="http://assets.en.oreilly.com/1/eventprovider/1/_@user_93485.jpg"><div>{name} {age}</div></div>',
        listeners: {
            itemtap: function(nestedList, list, index, target,record,e,eOpts) {
                //var id = record.get('items');
                alert('1');


            },
            activeitemchange:function(comp, activeRecord, oldRecord){
                alert('2');
            }
        }

    }

});

效果:

抱歉!评论已关闭.