PDA

View Full Version : [FIXED][2.2.1/3.0rc1] MultiSelect isDirty() always true



StephenDavison
6 May 2009, 7:44 AM
With ext-2.2, the MultiSelect list works fine for me, but I'm seeing something strange in ext-2.2.1 and 3.0-rc1. A multiselect component's isDirty() method always returns true, which is causing the containing form's isDirty() method to always be true too. (I'm creating the multiselect with isFormField true, and running both Firefox 3 and IE-7 under WindowsXP).



app = function() {
return {
init: function() {
var form = new Ext.form.FormPanel({
title: 'Unknown',
id: 'myform',
monitorValid: true,
labelAlign: 'top',
renderTo: Ext.getBody(),
listeners: {
clientValidation: function( form, valid) {
form.setTitle(
'Form is ' + (form.form.isDirty()?'DIRTY':'CLEAN')
+ ' | Select is ' + (Ext.getCmp('ms').isDirty()?'DIRTY':'CLEAN'));
}
},
items: [{
xtype: 'multiselect',
fieldLabel: 'Select',
id: 'ms',
name: 'ms',
isFormField: true,
dataFields: ["num"],
displayField: "num",
valueField: "num",
data: ["1","2","3"]
}]
});
}
}
}();

Ext.onReady(app.init, app);

StephenDavison
28 May 2009, 10:47 AM
Updated title to reflect 3.0rc1.1 with updated example code to reproduce the bug:



app = function() {
return {
init: function() {
var form = new Ext.form.FormPanel({
title: 'Unknown',
id: 'myform',
monitorValid: true,
labelAlign: 'top',
renderTo: Ext.getBody(),
listeners: {
clientValidation: function( form, valid) {
form.setTitle(
'Form is ' + (form.form.isDirty()?'DIRTY':'CLEAN')
+ ' | Select is ' + (Ext.getCmp('ms').isDirty()?'DIRTY':'CLEAN'));
}
},
items: [{
xtype: 'multiselect',
fieldLabel: 'Select',
id: 'ms',
name: 'ms',
isFormField: true,
store: [["1", "One"],["2", "Two"],["3", "Three"]]
}]
});
}
}
}();

Ext.onReady(app.init, app);

wiredmonkey
29 May 2009, 3:09 AM
I run into this very issue today using extjs 2.2.1, does anyone know how to resolve the issue?

Cheers

Shaun

evant
18 Jun 2009, 3:28 AM
This is fixed in SVN, both branches.

StephenDavison
18 Jun 2009, 6:01 AM
Thank you for your time and effort.

jdurante
2 Jul 2009, 10:40 AM
I ran into this today as well, using Ext 2.2.1. I can't use SVN, so this there a fix for this other than getting the code in SVN or upgrading to 3.0?

Thanks!

evant
2 Jul 2009, 10:44 AM
We will be releasing an updated version of the 2.x branch a little while after 3.x goes out the door.

jdurante
2 Jul 2009, 11:40 AM
Awesome. Thanks Evan!