Mercurial > lada > lada-client
changeset 1257:9a428be3907b
add action button in Messung grid and Ortszuordnung grid
author | Michael Stanko <mstanko@bfs.de> |
---|---|
date | Mon, 21 Nov 2016 08:07:54 +0100 |
parents | f961f94495c8 |
children | 835042fa1a1d |
files | app/view/grid/Messung.js app/view/grid/Ortszuordnung.js |
diffstat | 2 files changed, 49 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/app/view/grid/Messung.js Fri Nov 18 19:46:15 2016 +0100 +++ b/app/view/grid/Messung.js Mon Nov 21 08:07:54 2016 +0100 @@ -45,6 +45,22 @@ }] }]; this.columns = [{ + xtype: 'actioncolumn', + text: '', + dataIndex: 'readonly', + sortable: false, + width: 30, + getClass: function (val, meta, rec) { + if (rec.get('readonly') === false) { + return 'edit'; + } + return 'noedit'; + }, + handler: function(grid, rowIndex, colIndex) { + var rec = grid.getStore().getAt(rowIndex); + grid.fireEvent('itemdblclick', grid, rec); + } + }, { header: 'Nebenproben-Nr.', dataIndex: 'nebenprobenNr', flex: 1,
--- a/app/view/grid/Ortszuordnung.js Fri Nov 18 19:46:15 2016 +0100 +++ b/app/view/grid/Ortszuordnung.js Mon Nov 21 08:07:54 2016 +0100 @@ -46,6 +46,22 @@ }] }]; this.columns = [{ + xtype: 'actioncolumn', + text: '', + dataIndex: 'readonly', + sortable: false, + width: 30, + getClass: function (val, meta, rec) { + if (rec.get('readonly') === false) { + return 'edit'; + } + return 'noedit'; + }, + handler: function(grid, rowIndex, colIndex) { + var rec = grid.getStore().getAt(rowIndex); + grid.fireEvent('itemdblclick', grid, rec); + } + }, { header: 'Typ', dataIndex: 'ortszuordnungTyp', flex: 1, @@ -53,6 +69,15 @@ allowBlank: false } }, { + header: 'Ort-ID', + dataIndex: 'ortId', + flex: 2, + renderer: function(value) { + var store = Ext.data.StoreManager.get('orte'); + var record = store.getById(value); + return record.get('ortId'); + } + }, { header: 'Staat', dataIndex: 'ortId', flex: 1, @@ -86,9 +111,14 @@ return record2.get('bezeichnung'); } }, { - header: 'Ortszusatztext', - flex: 6, - dataIndex: 'ortszusatztext' + header: 'Anlage', + dataIndex: 'ortId', + flex: 3, + renderer: function(value) { + var store = Ext.data.StoreManager.get('orte'); + var record = store.getById(value); + return record.get('anlageId'); + } }]; this.listeners = { select: {