This might be simple, but I can't figure it out: How can I write a self-contained widget that handles its own callback from a dojo.io.bind() call? Specifically, how can I bind the callbacks (load, error) from a dojo.io.bind call to an object's method?
You could use:
this.clicked = function() {
dojo.io.bind({
url: this.actionURL,
method: 'get',
content: {
id: this.rowId,
field: this.dbField,
value: this.checked
},
load: dojo.lang.hitch(this, this.clickSuccess)
});
}