#12412 closed enhancement (wontfix)
ToggleButton: onChange arguments could be more useful
Reported by: | Colin Snover | Owned by: | anonymous |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | Dijit - Form | Version: | 1.6.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Currently, only the boolean value of the checked
attribute is provided when the onChange
event is fired, which is worthless in situations where the same event handler is bound to multiple different checkboxes/radiobuttons/whatever, which I imagine is a fairly common case. I’m not sure what the best option here would be; either adding value
as a second argument or provide the element itself as an argument or something else.
Change History (4)
comment:1 Changed 10 years ago by
Component: | General → Dijit |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
Summary: | ToggleButton onChange arguments could be more useful → ToggleButton: onChange arguments could be more useful |
comment:2 Changed 10 years ago by
dojo.declare('foo', [ dijit._Widget, dijit._Templated ], { templateString: '<div><input dojoType="dijit.form.Checkbox" dojoAttachEvent="onChange:_foo"></div>', _foo: function () { console.log(this); // foo } });
function myOnChangeHandler(checked){ console.log(this); // window } dojo.connect(checkbox, 'onChange', window, 'myOnChangeHandler');
comment:3 Changed 10 years ago by
The dojo.connect() call in your code example should be:
dojo.connect(checkbox, 'onChange', myOnChangeHandler);
comment:4 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|
Note: See
TracTickets for help on using
tickets.
The widget itself is already available as "this":