Opened 10 years ago
Closed 9 years ago
#13359 closed defect (fixed)
dojox.form.TriStateCheckbox setting value on creation
Reported by: | Kitson Kelly | Owned by: | Kitson Kelly |
---|---|---|---|
Priority: | high | Milestone: | 1.8 |
Component: | DojoX Form | Version: | 1.7.0b1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
The TriStateCheckbox? does not allow you to specify a value during startup and fires an onChange, no matter what the initial value is during startup.
For example:
var myCheckbox = new dojox.form.TriStateCheckbox({ id: "myCheckbox", value: "mixed", onChange: function(value) { console.log(value); } });
This will result in an output of false
being logged to the console and display an unchecked Checkbox. Clicking the Checkbox once will return true
and a third time to mixed
. Also either omitting the value or setting it to false
still causes an onChange
to fire.
Attachments (1)
Change History (6)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
Owner: | changed from dante to Kitson Kelly |
---|---|
Status: | new → assigned |
comment:3 Changed 9 years ago by
@kitsonk - attached a patch from SiQi and assigned to you. Please mark as 1.8, review and check in, if you feel comfortable. If not, assign back to me. Thanks.
comment:4 Changed 9 years ago by
Milestone: | tbd → 1.8 |
---|
Note: See
TracTickets for help on using
tickets.
When you specify a value for a TriStateCheckBox? during startup, if the value is one of false, true, 'mixed', it will be simply ignored. If the value is something else, then the value of the TriStateCheckBox?(checked status) will be set to it. The parameter of the onChange event is the checked attribute of the TriStateCheckBox? rather than the value (dijit.form.CheckBox? has the same behavior). You can print the value of the TriStateCheckBox? with following code:
The onChange event should not be triggered during startup and it's triggered before the value changed. It's a bug need to be fixed.