Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when propagating change from custom Widget #1310

Closed
scyv opened this issue Sep 9, 2016 · 1 comment
Closed

Issue when propagating change from custom Widget #1310

scyv opened this issue Sep 9, 2016 · 1 comment

Comments

@scyv
Copy link

scyv commented Sep 9, 2016

Hello,

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?

See here for the "fix": https://github.com/scyv/dgrid/commit/3536a966bf45fc9178718e8fef882014dd50a782

@msssk
Copy link
Contributor

msssk commented May 19, 2020

Fixed in #1405

@msssk msssk closed this as completed May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants