I'm having trouble with propagating a "change" event on a custom widget. This is my widget:
define([
"dojo/_base/declare",
"dijit/_Widget",
"dijit/_TemplatedMixin",
"dojo/on",
"dojo/text!./TopEditor.html",
], function (declare, _Widget, _TemplateMixin, on, domClass, template) {
return declare("myEditor", [_Widget, _TemplateMixin], {
templateString: template,
value: false,
_onClick: function (event) {
this.set("value", !this.get('value'));
this.emit("change");
},
_setValueAttr: function (value) {
this.value = value;
// ... do some dom stuff ...
}
});
});
Problem is, that in Line 477 of Editor.js (https://github.com/SitePen/dgrid/blob/master/Editor.js#L477) "this" is given to the _updatePropertyFromEditor method, while "this" in my context is the domNode of the widget and not the widget itself and then propagating of "dgrid-datachange" does not work . Changing "this" to "cmp" fixes the Problem. Am I doing something wrong? Is this a bug?
Hello,
I'm having trouble with propagating a "change" event on a custom widget. This is my widget:
Problem is, that in Line 477 of Editor.js (https://github.com/SitePen/dgrid/blob/master/Editor.js#L477) "this" is given to the _updatePropertyFromEditor method, while "this" in my context is the domNode of the widget and not the widget itself and then propagating of "dgrid-datachange" does not work . Changing "this" to "cmp" fixes the Problem. Am I doing something wrong? Is this a bug?
See here for the "fix": https://github.com/scyv/dgrid/commit/3536a966bf45fc9178718e8fef882014dd50a782