You can attached your data to the change event you triggered. You should have something like :
this._trigger('change', e);
and could use :
this._trigger('change', e, { widgetData: this.getWidgetData() });
The _trigger
function accepts A hash of data associated with the event.
as its third arg as decribed in the documentation.
And your code will become :
$("#myDiv").myWidget({
change: function(e, data) {
alert(data.widgetData);
// do something with the widget data.
}
});