[Dojo-interest] Is this where I should use dojo.hitch?
Devine, James
james.devine at fmr.com
Thu Jul 23 09:03:55 EDT 2009
I've got this code inside a custom TabContainer's selectChild method.
On selectChild, I stop the user if any of the grid stores are dirty and
present them with a dialog to notify them that they need to update or
revert changes.
The revertButton should revert any dirty stores (which it does) and then
perform the selectChild function (basically call this.inherited).
var revertHandle = dojo.connect(revertButton, "onClick", function() {
for (var i=0; i < dirtyStores.length; i++) {
dirtyStores[i].revert();
}
dialog.hide();
dojo.disconnect(revertHandle);
this.inherited(arguments); // 'this' is no longer the tab container in
this context
});
The problem is that the tab container is no longer "this" in the connect
callback. How is this supposed to be implemented? I'm thinking it
should use dojo.hitch, but I am confused as to how to implement.
Thanks,
Jim
More information about the Dojo-interest
mailing list