1. #1
    Sencha User
    Join Date
    Jan 2011
    Posts
    3
    Vote Rating
    0
    RedOnion is on a distinguished road

      0  

    Default list item swipe in carousel

    list item swipe in carousel


    Hi,
    new to Touch, been using ExtJs for a couple of years.

    I have a two lists as items in a carousel. I want to be able to select an item on list one "people list" and swipe over to list 2 "team list" with the corresponding data loaded. The code below works for that - trouble is that I can still swipe from below the list iteself. Which is normal carousel behaviour I understand, But I am wondering could sombody point be to some way around this. i.e. to only allow swipes from list items.

    The reason I have a carousel here is that I want to be able to swipe left and right.

    Thanks


    Code:
    var carousel = new Ext.Carousel({
        fullscreen: true,
        indicator:false,
    
        items:[{
    
            xtype : 'list',
            id:'people-list',
            fullscreen:true,
            itemTpl: new Ext.XTemplate(
    
                '<div class="profile-block">',
                '//other template stuff',
                '</div>'
    
                ),
            store : peopleStore,
            singleSelect : true,
            listeners:{
                itemswipe:{
                    fn:function(view,index,item,event){
    
                        rec=peopleStore.getAt(index);
                        person_id=rec.data.person_id;
                        teamStore.getProxy().extraParams.person_id = person_id;
                        teamStore.load();
    
    
    
                    }
                }
    
    
            }
    
        },{
            xtype : 'list',
            id:'team-list',
            fullscreen:true,
            itemTpl: new Ext.XTemplate(
    
                '<div class="detail">',
                '//template stuff',
                '</div>'
    
                ),
            store : teamStore,
            singleSelect : true
    
        }]
    });

  2. #2
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    3
    Vote Rating
    0
    fangunxs is on a distinguished road

      0  

    Default


    Maybe too late to response to this question. But still try to help in case anybody search similar questions and got here. Ok, below is my solution:

    With ST 2.1.1 'itemswipe' or 'swipe' event, you can do this:
    listeners: {
    swipe: {
    fn: function(evt, node, options, eOpts){
    if(evt.direction == 'left'){ // do something
    }else{ // do other things
    }
    },
    element: 'element'
    }
    },

    So, I think not necessary use carousel.

Thread Participants: 1