How to access the "True" "this" of an ob
If "this" inside of a sortable "receive" function refers to the receiving object, How do I access the object to which the receive function belongs?
Example:
-
// Function that takes a JQ object and makes it sortable.
// We assign the "SortableRecieve" method to the receive event
MyObject.prototype.MakeSortable = function(JQOBJ)
{
JQOBJ.sortable({
receive: this.SortableRecieve
});
}
MyObject.prototype.DoSomething = function()
{
// Does something important
}
// The actual function that gets called when the receive event occurs
MyObject.prototype.SortableRecieve = function(event, ui)
{
// This function call won't work, because "this"
// doesn't point to the right thing!
this.DoSomething();
}
So how can I access the "True" this that refers to the object?