-
8 Jun 2012 5:43 AM #1
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
// Here my code to access that tool bar using toolbar id in controllers initialize methodCode:{ xtype:'toolbar', docked:'bottom', id:'menuBackPanel' }
// here my code to navigate to another viewCode:var meta = Ext.getCmp('menuBackPanel'); if (meta) { meta.element.on({ swipe: function (e) { appName.app.getController('appName.controller.MenuController').triggerTest(cc); } }); }
//My problem is that when i swipe the toolbar event not generatingCode:triggerTest: function(cc) { var cc = this.getHomepage(); Ext.Viewport.animateActiveItem(cc, this.slideUpTransition); }
-
10 Jun 2012 10:17 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,682
- Vote Rating
- 435
Instead of doing
I would fire a custom event on the toolbar and have the controller listen for that event.Code:appName.app.getController('appName.controller.MenuController').triggerTest(cc);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.
-
26 Jun 2012 11:33 AM #3
Add this to ur Ext.application:
eventPublishers: {
touchGesture: {
recognizers: {
swipe: {
//this will include both vertical and horizontal swipe recognisers
xclass: 'Ext.event.recognizer.Swipe'
}
}
}
}


Reply With Quote