-
9 Mar 2012 1:49 AM #1
Unanswered: Catching dragstart/dragend in a controller
Unanswered: Catching dragstart/dragend in a controller
Hello
I'm trying to catch the dragstart/dragend events for a container I've made draggable. But I only seem to be able to catch these if I attach listeners directly to the draggable part of the config for the container. I'd like these to be in the control config of my controller, but just attaching them to the container itself doesn't work. Is there some other way I need to reference them to catch the events?
Thanks
Stephen
-
9 Mar 2012 5:42 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,682
- Vote Rating
- 435
- Answers
- 3111
Since the events are on the element you can fire the on the component which would then be listenable from the controller.
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.
-
9 Mar 2012 7:04 AM #3
Thanks, I think I understand, although I'm entirely sure how to implement it. From my inside my container's config:draggable....
In this case I think I'm just making the listener fire over and over. How can I reach the component from inside this element? Sorry if it's a really dumb question!Code:listeners: { dragend: function() { this.fireEvent('dragend', arguments); }, dragstart: { fn: function() { this.fireEvent('dragstart', arguments); }, order: 'before' } }
Thanks
Stephen


Reply With Quote