diff app/view/zusatzwerte/List.js @ 545:7c9475119861 mockup-1.1

Enable the 'details' button only when an item is selected
author Roland Geider <roland.geider@intevation.de>
date Thu, 18 Dec 2014 15:59:47 +0100
parents 99e738c17b81
children
line wrap: on
line diff
--- a/app/view/zusatzwerte/List.js	Thu Dec 18 15:04:21 2014 +0100
+++ b/app/view/zusatzwerte/List.js	Thu Dec 18 15:59:47 2014 +0100
@@ -37,7 +37,8 @@
             items: ['->', {
                 text: 'Details',
                 icon: 'gfx/document-open.png',
-                action: 'open'
+                action: 'open',
+                disabled: true
             }, {
                 text: 'Hinzufügen',
                 icon: 'gfx/list-add.png',
@@ -103,5 +104,15 @@
             }*/
         }];
         this.callParent(arguments);
+    },
+    listeners: {
+        selectionchange: function(model, selected, eOpts) {
+            /*
+            * Enable the 'details' button only when an item is selected
+            */
+            if (selected.length > 0) {
+                this.down('button[action=open]').enable();
+            }
+        }
     }
 });

http://lada.wald.intevation.org