Mercurial > lada > lada-client
diff app/view/grid/Status.js @ 684:69cb367c0a63
When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Wed, 25 Mar 2015 15:04:45 +0100 |
parents | 612f4f933083 |
children | 9ab7b1eed9f8 |
line wrap: on
line diff
--- a/app/view/grid/Status.js Wed Mar 25 09:07:20 2015 +0100 +++ b/app/view/grid/Status.js Wed Mar 25 15:04:45 2015 +0100 @@ -26,6 +26,7 @@ this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { clicksToMoveEditor: 1, autoCancel: false, + pluginId: 'rowedit', listeners:{ // Make row ineditable when readonly is set to true // Normally this would belong into a controller an not the view. @@ -140,5 +141,23 @@ messungsId: this.recordId } }); + }, + + setReadOnly: function(b) { + if (b == true){ + //Readonly + if (this.getPlugin('rowedit')){ + this.getPlugin('rowedit').disable(); + } + this.down('button[action=delete]').disable(); + this.down('button[action=add]').disable(); + }else{ + //Writable + if (this.getPlugin('rowedit')){ + this.getPlugin('rowedit').enable(); + } + this.down('button[action=delete]').enable(); + this.down('button[action=add]').enable(); + } } });