Mercurial > lada > lada-client
diff app/controller/Status.js @ 540:99e738c17b81
Add detail button to tables
author | Roland Geider <roland.geider@intevation.de> |
---|---|
date | Wed, 17 Dec 2014 16:59:45 +0100 |
parents | 6ad453afbc31 |
children |
line wrap: on
line diff
--- a/app/controller/Status.js Wed Dec 17 15:42:55 2014 +0100 +++ b/app/controller/Status.js Wed Dec 17 16:59:45 2014 +0100 @@ -23,9 +23,9 @@ addListeners: function() { this.control({ - //'statuslist': { - // itemdblclick: this.editItem - //}, + 'statuslist toolbar button[action=open]': { + click: this.editItem + }, 'statuslist toolbar button[action=add]': { click: this.addItem }, @@ -55,7 +55,12 @@ }); }, - editItem: function(grid, record) { + editItem: function(button) { + var grid = button.up('grid'); + var selection = grid.getView().getSelectionModel().getSelection()[0]; + var statusId = selection.getId(); + var record = selection.store.getById(statusId); + var mstore = Ext.data.StoreManager.get('Messungen'); var messung = mstore.getById(record.get('messungsId')); record.getAuthInfo(this.initEditWindow, messung.get('probeId'));