Hybrid View

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    32
    Answers
    5
    Vote Rating
    0
    paulroth3d is on a distinguished road

      0  

    Default Answered: Swipe on components other than list

    Answered: Swipe on components other than list


    Hello,

    Is it possible to use the swipe recognizer on other components than the list?

    I found this fiddle: http://www.senchafiddle.com/#DbH5t that allows me to swipe on a container, but it uses an internal private class.

    Specifically I'm looking to swipe left or right on a button.

    Has anyone worked with this before or have any thoughts?

    thanks,
    Paul

  2. Ugh, so this was difficult, but I found a solution:

    Code:
    Ext.application({
        name: 'swipeTest',
        //change the default recognisers
        eventPublishers: {
            touchGesture: {
                recognizers: {
                    swipe: {
                        //this will include both vertical and horizontal swipe recognisers
                        xclass: 'Ext.event.recognizer.Swipe'
                    }
                }
            }
        },
        launch: function() {
            Ext.create('Ext.Panel', {
                fullscreen: true,
                scrollable: true,
                html: 'This is a Panel',
                items: [{
                    xtype: 'titlebar',
                    docked: 'top',
                    title: 'Panel'
                },{
                    xtype: 'button',
                    text: 'Swipe on button supported',
                    name: 'myButton',
                    id: 'myButtony'
                }],
                listeners: {
                    initialize: function(comp , eOpts){
                        var btn = comp.down( "button" );
                        btn.element.on(
                            'swipe', 
                            function(event, node, options, eOpts) {
                                Ext.Msg.alert('swipe', 'direction: '+event.direction, Ext.emptyFn);
                            },
                            comp
                        );
                    }
                }
            });
        }
    });

  3. #2
    Sencha User
    Join Date
    Feb 2012
    Posts
    32
    Answers
    5
    Vote Rating
    0
    paulroth3d is on a distinguished road

      0  

    Default


    Ugh, so this was difficult, but I found a solution:

    Code:
    Ext.application({
        name: 'swipeTest',
        //change the default recognisers
        eventPublishers: {
            touchGesture: {
                recognizers: {
                    swipe: {
                        //this will include both vertical and horizontal swipe recognisers
                        xclass: 'Ext.event.recognizer.Swipe'
                    }
                }
            }
        },
        launch: function() {
            Ext.create('Ext.Panel', {
                fullscreen: true,
                scrollable: true,
                html: 'This is a Panel',
                items: [{
                    xtype: 'titlebar',
                    docked: 'top',
                    title: 'Panel'
                },{
                    xtype: 'button',
                    text: 'Swipe on button supported',
                    name: 'myButton',
                    id: 'myButtony'
                }],
                listeners: {
                    initialize: function(comp , eOpts){
                        var btn = comp.down( "button" );
                        btn.element.on(
                            'swipe', 
                            function(event, node, options, eOpts) {
                                Ext.Msg.alert('swipe', 'direction: '+event.direction, Ext.emptyFn);
                            },
                            comp
                        );
                    }
                }
            });
        }
    });

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi