Mercurial > lada > lada-client
diff app/view/messwerte/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/messwerte/List.js Thu Dec 18 15:04:21 2014 +0100 +++ b/app/view/messwerte/List.js Thu Dec 18 15:59:47 2014 +0100 @@ -40,7 +40,8 @@ items: ['->', { text: 'Details', icon: 'gfx/document-open.png', - action: 'open' + action: 'open', + disabled: true }, { text: 'Hinzufügen', icon: 'gfx/list-add.png', @@ -111,5 +112,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(); + } + } } });