Click event on checkbox
Can please someone explain to me how can i add a click event on a checkbox in my form. i have tried check,change,handler but they all seem to fire when the form loads, something that i don't want to. i simply want to alert the user with a message when he clicks on the checkbox.
I'd actually suggest CheckBox.addValueChangeHandler. This will give you several kinds of changes:
o Any toggle of the checkbox (click or space bar)
o Any click on the label to the right of the checkbox (This text is set via CheckBox.setBoxLabel)
o Any invocation of CheckBox.setValue(newValue, true) - the second parameter set to true means 'fire a valuechangeevent'.
ChangeEvent won't go off in the second two cases, ClickEvent won't go off in at least the last case and perhaps more.
ChangeEvent and ClickEvent are the DOM events themselves, while ValueChangeHandler is a logical event, sent by the widget, only in cases that make sense.
As far as firing when the page loads, take a look at http://www.sencha.com/examples/#Exam...e:formsexample - this has ValueChangeHandlers set on the CheckBoxes, but they dont go off when the basic values are set.
gah! i keep forgetting about that one - one of these days you'd think i would remember.