Hi,
I couldn't find anything about this in the rest of the forum, so I'm reporting a bug for it. I have a checkbox, which has a handler to ask the user to confirm they want to uncheck it (as it removes some data permanently if they do).
I do this with a Ext.MessageBox.confirm dialog box called from the "check" handler of the checkbox. If the user clicks "No", then I won't remove the data, but I also need to have the checkbox become checked again. Using setValue works, but also fires the handler, which I don't really want, as it's then difficult to detect whether it was a user click, or as a result of the above handler. I'd rather use setRawValue, but this doesn't work for checkboxes, as it's not overridden to set "checked" on the DOM element.
Suggested code in the Checkbox function would be:
1. Remove the following code:
Code:
setValue : function(v){
this.checked = (v === true || v === 'true' || v == '1' || String(v).toLowerCase() == 'on');
if(this.el && this.el.dom){
this.el.dom.checked = this.checked;
this.el.dom.defaultChecked = this.checked;
}
this.fireEvent("check", this, this.checked);
}
2. Replace with
Code:
setRawValue : function(v){
this.checked = (v === true || v === 'true' || v == '1' || String(v).toLowerCase() == 'on');
if(this.el && this.el.dom){
this.el.dom.checked = this.checked;
this.el.dom.defaultChecked = this.checked;
}
},
setValue : function(v){
setRawValue(v);
this.fireEvent("check", this, this.checked);
}
This will also apply to Radio buttons by the looks of things in the code.
thanks,
Steve