-
24 Oct 2012 7:36 AM #1
Unanswered: setXY can't find the right dom element - inside touchend listener of dataview button
Unanswered: 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
-
26 Oct 2012 6:15 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3108
Do you know what target is? It doesn't really look like you have looked to see what it was.
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 Oct 2012 6:34 AM #3
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.
-
26 Oct 2012 7:30 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3108
Set a breakpoint on it and look at the dev tools, it's not the component
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.


Reply With Quote