Hi Schnatter,

Hurray for javascript closures :)


You can do something like this:

load : function() {
   // Some other stuff
   $("#dragTarget").draggable({
     var testfunc = this.test;
     snap: "#dropTarget", stop: function(event, ui) {
       testfunc(); //call the function
     } // end stop
   }); // end draggable
}


Or this:

load : function() {
   // Some other stuff
   $("#dragTarget").draggable({
     snap: "#dropTarget", stop: qx.lang.Function.bind(function(event, ui) {
       this.test(); //call the function
     }, this)
   }); // end draggable
}


In the second version, "this" in the stop function refers to the qooxdoo 
object, while in the first version it does not.


Regards,
Marc








On 03/28/2012 04:40 PM, schnatter wrote:
> Hi everybody, I have 2 qooxdoo functions test and load. Load is called 
> and uses jquery to make an element draggable. After stop dragging 
> another function is called. How can I call the qooxdoo test function 
> from the function which is called from test (see code)? test : 
> function() { alert("Test"); }, load : function() { // Some other stuff 
> $("#dragTarget").draggable({ snap: "#dropTarget", stop: 
> function(event, ui) { // I WANT TO CALL qooxdoo test FROM THIS 
> POSITION } // end stop }); // end draggable }



------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to