Event Scoping in 1.4

Event Scoping in 1.4


Hello,
I've looked at the event scoping feature on 1.4 roadmap and I'm
wondering if we really need to add a scope parameter?
Here's what I would like to propose as a solution that would not break
with existing designs:
$("#elmentid").bind('click', [obj, fn]);
$("#elmentid").bind('click', data, [obj, fn]);
the scoped callback would take the form [obj, fn]
example:
var myobj = {
property: "value",
saveHandle: function() {
// code here
}
};
var handler = function() {
// code here
}
$("#elementid").bind('click',[myobj,handler]); // callback handler
with myobj scope
$("#elementid").bind('click',[myobj,"saveHandle"]); // callback
saveHandle on myobj
$("#elementid").bind('click',[myobj,myobj.saveHandle]); // callback
saveHandle on myobj
Callback with data and scope
var data = {property1:"value1", property2:'' }
$("#elementid").bind('click', data, [myobj,"saveHandle"]); // callback
saveHandle on myobj