1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    8
    Vote Rating
    0
    swathi001 is on a distinguished road

      0  

    Default How to generate up and down swipe event on toolbar

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,682
    Vote Rating
    435
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

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

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    1
    Vote Rating
    0
    ckd is on a distinguished road

      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