Results 1 to 3 of 3

Thread: How to generate up and down swipe event on toolbar

  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    8
    Vote Rating
    0
      0  

    Default How to generate up and down swipe event on toolbar

    // I am able to generate left and right swipe functionality on toolbar but its not working on up and down swipe. Here is my code from view first i am creating toolbar
    Code:
     {  
                  xtype:'toolbar',
                  docked:'bottom',
                  id:'menuBackPanel'
      }
    // Here my code to access that tool bar using toolbar id in controllers initialize method

    Code:
    var meta = Ext.getCmp('menuBackPanel');
     if (meta)
     {
       meta.element.on({ swipe: function (e) 
        {
                appName.app.getController('appName.controller.MenuController').triggerTest(cc);
         }
       });
     }
    // here my code to navigate to another view
    Code:
    triggerTest: function(cc)
    {
              var cc = this.getHomepage();
             Ext.Viewport.animateActiveItem(cc, this.slideUpTransition);
       }
    //My problem is that when i swipe the toolbar event not generating

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    Instead of doing

    Code:
    appName.app.getController('appName.controller.MenuController').triggerTest(cc);
    I would fire a custom event on the toolbar and have the controller listen for that event.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    2
    Vote Rating
    0
      0  

    Default

    Add this to ur Ext.application:

    eventPublishers: {
    touchGesture: {
    recognizers: {
    swipe: {
    //this will include both vertical and horizontal swipe recognisers
    xclass: 'Ext.event.recognizer.Swipe'
    }
    }
    }
    }

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •