I have the following code to call an function on each button in a page.
dojo.query('.btn').forEach(function(item){
Obj = new MyClass(item); // class calls the ajax request on error of each btn click I have to handle some functionality in below function showError
dojo.connect(Obj, 'showError', dojo.hitch(Obj, function(errors){
console.log(Obj + 'came');
}));
Here I tried using dojo.hitch to maintain state of each object Obj, But it is not maintaining.Only first Obj is firing.For second Button also, the first Obj is firing.Is there anything I am missing here.