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);
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);