-
15 Apr 2010 6:32 AM #1
[OPEN-865] isDirty on radiogroup
[OPEN-865] isDirty on radiogroup
Ext version tested:
- Ext 3.2 rev ____
Adapter used:- ext
css used:- only default ext-all.css
Browser versions tested against:- FF3 (firebug 1.3.0.10 installed)
Operating System:- Win7
Description:- When loading json data to a form with radiogroup and later checking isDirty, radiogroup is always returned dirty. It because originalValue is not set on radios inside group but only on group itself. When isDirty from checkboxgroup is called it checks isDrity for every radio, which is always true.
Test Case:
See this URL : http://Code:<<insert working code to reproduce the report >>
Steps to reproduce the problem:- use form from samples
- load json object into form
Debugging already done:- yes
Possible fix:- bellow is isDirty for raidogroup
Code:// private isDirty: function(){ //override the behaviour to check sub items. if (this.disabled || !this.rendered) { return false; } var dirty = false; if (this.getValue().getRawValue() != this.originalValue.getRawValue()) { dirty = true; } return dirty; }
-
19 May 2010 2:14 AM #2
Yeah, pretty sad actually that radio groups and checkbox groups have sucked from first introduction (mind you, that was about 5 versions ago!!) and still suck up untill this day. Both groups still malfunction horribly when using trackResetOnload. I've posted numerous bug reports on this, but I'm done reporting bugs for ExtJs.
-
3 Mar 2011 2:13 AM #3
Will this be solved somehow? "Patch" or v4?
-
17 Jun 2011 5:35 AM #4
Tell this problem till now it is not solved?

-
27 Jun 2011 1:45 PM #5
Possible fix?
Possible fix?
I'm using Ext 3.3.x. The following code seems to fix the behavior of isDirty() in radiogroup. Am I missing something? Seems like such a simple fix to not be fixed in Ext js's code. Will this fix cause other problems?
Code:Ext.override(Ext.form.RadioGroup, { isDirty: function() { if (this.originalValue == undefined){ return false; } if (this.originalValue.inputValue == this.getValue().inputValue ){ return false; } return true; } });
-
28 Jun 2011 12:40 AM #6
this problem in function setValues in class Ext.form.BasicForm
Code:Ext.form.BasicForm.override ({ setValues : function(values){ if(Ext.isArray(values)){ // array of objects for(var i = 0, len = values.length; i < len; i++){ var v = values[i]; var f = this.findField(v.id); if(f){ f.setValue(v.value); if (this.trackResetOnLoad) { if (f instanceof Ext.form.CheckboxGroup) { f.eachItem(function(item){ if (item instanceof Ext.form.Checkbox) item.originalValue = item.getValue(); }); } else { f.originalValue = f.getValue(); } } } } }else{ // object hash var field, id; for(id in values){ if(!Ext.isFunction(values[id]) && (field = this.findField(id))){ field.setValue(values[id]); if (this.trackResetOnLoad) { if (field instanceof Ext.form.CheckboxGroup) { field.eachItem(function(item){ if (item instanceof Ext.form.Checkbox) item.originalValue = item.getValue(); }); } else { field.originalValue = field.getValue(); } } } } } return this; }, });
-
10 Mar 2013 1:57 PM #7
I've just faced this problem and found this thread while trying to find a solution. And I'm also surprised and disappointed that this is issue is still not fixed.
This thread suggested a fix but I'm hesitating to apply it since it may cause violations in other parts.
Did anyone found and applied a safe fix?
Ipek
You found a bug! We've classified it as
EXTJSIII-104
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote