1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    13
    Vote Rating
    0
    stevenewey is on a distinguished road

      0  

    Default 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

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,541
    Vote Rating
    872
    Answers
    3566
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    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
    ________________
    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 in print!

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

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    13
    Vote Rating
    0
    stevenewey is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Since the events are on the element you can fire the on the component which would then be listenable from the controller.
    Thanks, I think I understand, although I'm entirely sure how to implement it. From my inside my container's config:draggable....

    Code:
    listeners: {
      dragend: function() {
        this.fireEvent('dragend', arguments);
      },
      dragstart: {
        fn: function() {
          this.fireEvent('dragstart', arguments);
        },
        order: 'before'
      }
    }
    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!

    Thanks
    Stephen

  4. #4
    Sencha User
    Join Date
    Nov 2013
    Posts
    47
    Vote Rating
    1
    Answers
    1
    anilvardhan.p is on a distinguished road

      0  

    Default hi stevenewey

    hi stevenewey


    I seen your example.
    I am searching for implementing dragstart event after a taphold/longpress fucntion.
    My requirement is "drag" should start only on longpress/taphold on the item. for normal dragging it shouldn't mpve.

    How to implement it.

    Thanks you.