sjivan
3 Aug 2007, 5:15 AM
- Ext version : 1.1 final
- yui adapter
- windows xp
- IE 6.0.29 SP2
I realize that this issue has been posted before but I wasn't able to find a solution. setValue(true) on a checkbox or creating a checkbox with config proeprty checked : true still does not work in IE 6 even with Ext 1.1 release. After investigating the issue I found this useful link http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=842144&SiteID=1 which goes over all combinations of IE / checkbox / creation method / set value combinations. I then looked at the GWT CheckBox code and the GWT code does
public void setChecked(boolean checked) {
DOM.setElementPropertyBoolean(inputElem, "checked", checked);
DOM.setElementPropertyBoolean(inputElem, "defaultChecked", checked);
}
which is consistent with the findings in the aforementioned article.
So I updated the code locally in Ext such that Checkbox#setValue has
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);
}
and this now works with IE 6. There are other places in Ext where checkboxes are used and a similar logic should be applied there as well. For example in the TreeNodeUI with checkbox.
I realize this is a browser bug but feel that the Ext code should be updated to handle this IE 6 quirk.
Sanjiv
- yui adapter
- windows xp
- IE 6.0.29 SP2
I realize that this issue has been posted before but I wasn't able to find a solution. setValue(true) on a checkbox or creating a checkbox with config proeprty checked : true still does not work in IE 6 even with Ext 1.1 release. After investigating the issue I found this useful link http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=842144&SiteID=1 which goes over all combinations of IE / checkbox / creation method / set value combinations. I then looked at the GWT CheckBox code and the GWT code does
public void setChecked(boolean checked) {
DOM.setElementPropertyBoolean(inputElem, "checked", checked);
DOM.setElementPropertyBoolean(inputElem, "defaultChecked", checked);
}
which is consistent with the findings in the aforementioned article.
So I updated the code locally in Ext such that Checkbox#setValue has
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);
}
and this now works with IE 6. There are other places in Ext where checkboxes are used and a similar logic should be applied there as well. For example in the TreeNodeUI with checkbox.
I realize this is a browser bug but feel that the Ext code should be updated to handle this IE 6 quirk.
Sanjiv