diff app/view/grid/Status.js @ 969:d4603049cd42

Fixed edit status. Only the last record is editable.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 12 Nov 2015 17:38:57 +0100
parents 8fabf9a3fee7
children c2a726887dd7
line wrap: on
line diff
--- a/app/view/grid/Status.js	Thu Nov 12 16:15:37 2015 +0100
+++ b/app/view/grid/Status.js	Thu Nov 12 17:38:57 2015 +0100
@@ -38,20 +38,7 @@
             clicksToMoveEditor: 1,
             autoCancel: false,
             disabled: true,
-            pluginId: 'rowedit',
-            listeners:{
-                // Make row ineditable when readonly is set to true
-                // Normally this would belong into a controller an not the view.
-                // But the RowEditPlugin is not handled there.
-                beforeedit: function(e, o) {
-                var readonlywin = o.grid.up('window').record.get('readonly');
-                    var readonlygrid = o.record.get('readonly');
-                    if (readonlywin == true || readonlygrid == true || this.disabled)  {
-                        return false;
-                    }
-                    return true;
-                }
-            }
+            pluginId: 'rowedit'
         });
         this.plugins = [this.rowEditing];
 
@@ -172,16 +159,9 @@
     setReadOnly: function(b) {
         if (b == true){
             //Readonly
-            if (this.getPlugin('rowedit')){
-                this.getPlugin('rowedit').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();
         }
     }

http://lada.wald.intevation.org