PDA

View Full Version : Correct usage of Ext.Editor.ignoreNoChange?



gubespam
24 Oct 2011, 1:31 PM
I'd like to use the "ignoreNoChange" config of Ext.Editor for the cell editors in my grid panel. What is the correct way to set up the config for the grid panel? I assumed I could just add a config key to the "editor" config, but that doesn't work.


columns: [
{
header: 'Length',
dataIndex: 'externalField.fieldLength',
type: 'number',
editor: {
xtype: 'numberfield',
minValue: 1,
ignoreNoChange: true
}
}, ...

Looking at the source, it appears that the editor config is stored as the "field" member object of Ext.Editor (so access should be as "this.field.ignoreNoChange"), but the code is checking against me/this.ignoreNoChange instead. Is this a bug?


if (String(value) === String(me.startValue) && me.ignoreNoChange) {
me.hideEdit(remainVisible);
return;
}

skirtle
24 Oct 2011, 2:24 PM
It isn't entirely clear to me how the various config options of an Ext.Editor are supposed to be used as it is usually created implicitly. Something like this perhaps?


editor: {
ignoreNoChange: true,
xtype: 'editor',
field: {
minValue: 1,
xtype: 'numberfield'
}
}

Not sure if that would work or not. Alternatively, it seems that the getEditor() method on a column is designed to be able to return an editor, so you could try overriding that (just specify it in your column config).