0
我在自定義控件上傳播「更改」事件時遇到問題。這是我的小工具:dgrid:從自定義控件傳播更改時發出的問題
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 ...
}
});
});
問題是,在線路editor.js內的477(https://github.com/SitePen/dgrid/blob/master/Editor.js#L477)「這」是考慮到_updatePropertyFromEditor方法,而「本」在我的背景是小工具的れ和不是小部件本身,然後傳播「dgrid-datachange」不起作用。難道我做錯了什麼?有錯誤嗎?