Is there a way to make an ExtJS4 PropertyGrid (Ext.grid.property.Grid) non-editable?
There is no "editable" or "readonly" config option AFAICS.
Another solution is to add a listener, that prevents starting the editing component:
listeners: {
'beforeedit': {
fn: function () {
return false;
}
}
}
The problem with this solution is, that one can not mark a cell to copy (Ctrl+C) the contents.
Use the sourceConfig to set the editor to a Ext.form.DisplayField:
Ext.create('Ext.grid.PropertyGrid', {
sourceConfig: {
field1: {
displayName: 'Editable Field'
},
field2: {
displayName: 'Readonly Field',
editor: Ext.create('Ext.form.DisplayField')
}
},
source: {
field1: "Some property",
field2: "Some other property",
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With