comparison app/view/grid/FilterResult.js @ 878:545b8913601d

Applied patch from Workshop: The RW-Icon in the Probenliste is now clickable. This somehow affected the List of Proben which is now more dense.
author Dustin Demuth <dustin@intevation.de>
date Fri, 17 Jul 2015 15:44:51 +0200
parents b90e29b22ea6
children 07dfcdf5b41f
comparison
equal deleted inserted replaced
877:a58c006f869c 878:545b8913601d
121 121
122 /** 122 /**
123 * Setup columns of the Grid dynamically based on a list of given cols. 123 * Setup columns of the Grid dynamically based on a list of given cols.
124 * The function is called from the {@link Lada.controller.Filter#search 124 * The function is called from the {@link Lada.controller.Filter#search
125 * search event} 125 * search event}
126 * The Images for the Read-Write Icon are defined in CSS
126 */ 127 */
127 setupColumns: function(cols) { 128 setupColumns: function(cols) {
128 var resultColumns = []; 129 var resultColumns = [];
129 var fields = []; 130 var fields = [];
130 131
134 fields.push(new Ext.data.Field({ 135 fields.push(new Ext.data.Field({
135 name: 'readonly' 136 name: 'readonly'
136 })); 137 }));
137 138
138 resultColumns.push({ 139 resultColumns.push({
139 header: 'RW', 140 xtype: 'actioncolumn',
141 text: 'RW',
140 dataIndex: 'readonly', 142 dataIndex: 'readonly',
141 sortable: false, 143 sortable: false,
144 tooltip: 'Probe öffnen',
142 width: 30, 145 width: 30,
143 renderer: function(value, meta, record) { 146 getClass: function (val, meta, rec) {
144 if ( !value && record.get('owner')) { 147 return rec.get('readonly') === false ? "edit" : "noedit";
145 return '<img src="resources/img/view-time-schedule-edit.png"/>'; 148 },
146 } 149 handler: function(grid, rowIndex, colIndex) {
147 return '<img src="resources/img/view-time-schedule-baselined.png"/>'; 150 var rec = grid.getStore().getAt(rowIndex);
148 } 151 grid.fireEvent('itemdblclick', grid, rec);
152 }
149 }); 153 });
150 154
151 for (var i = cols.length - 1; i >= 0; i--) { 155 for (var i = cols.length - 1; i >= 0; i--) {
152 if (cols[i] === 'id') { 156 if (cols[i] === 'id') {
153 continue; 157 continue;
160 if (this.store.$className == 'Lada.store.ProbenList') { 164 if (this.store.$className == 'Lada.store.ProbenList') {
161 // Add a Delete-Button 165 // Add a Delete-Button
162 // TODO: Might need to be extended to Messprogramme 166 // TODO: Might need to be extended to Messprogramme
163 resultColumns.push({ 167 resultColumns.push({
164 xtype: 'actioncolumn', 168 xtype: 'actioncolumn',
165 header: 'Aktionen', 169 text: 'Aktion',
166 sortable: false, 170 sortable: false,
167 width: 30, 171 width: 30,
168 items: [{ 172 items: [{
169 icon: 'resources/img/edit-delete.png', 173 icon: 'resources/img/edit-delete.png',
170 tooltip: 'Löschen', 174 tooltip: 'Löschen',

http://lada.wald.intevation.org