Results 1 to 4 of 4

Thread: setXY can't find the right dom element - inside touchend listener of dataview button

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    2
    Vote Rating
    0
      0  

    Default setXY can't find the right dom element - inside touchend listener of dataview button

    Hi,

    I'm trying to revert the position of a draggable button (within a dataview) using setXY in its touchEnd listener. I used many combinations of Ext.fly, Ext.get, Ext.getDom, but they get null, div element or an object where setXY is not defined. Appreciate your help in making this work or suggesting some other way to revert position.

    Code:
    touchEnd: function(dataview, index, target, record, e, options) {
            //xxStart and yStart were saved from touchStart
            xMov = e.pageX - xStart;
            yMov = e.pageY - yStart;
            
           //var pos = e.getXY();   //this worked
            Ext.fly(target.getNameButton().getId).setXY([e.pageX-xMov, e.pageY-yMov]);  //gives error

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1381
      0  

    Default

    Do you know what target is? It doesn't really look like you have looked to see what it was.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

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

    Default

    Thanks for replying. Isn't target the Ext component where the event was fired? I am not sure since I could not find target explicitly listed as a parameter in the documentation of touchEnd. Where can I confirm this? Alternatively, which would be dom element I can use with setXY to revert position? Thanks.

  4. #4
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1381
      0  

    Default

    Set a breakpoint on it and look at the dev tools, it's not the component
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

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
  •