changeset 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 a58c006f869c
children 729bfea7e8b1
files app/view/grid/FilterResult.js resources/css/lada.css
diffstat 2 files changed, 31 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/app/view/grid/FilterResult.js	Fri Jul 17 15:24:27 2015 +0200
+++ b/app/view/grid/FilterResult.js	Fri Jul 17 15:44:51 2015 +0200
@@ -123,6 +123,7 @@
      * Setup columns of the Grid dynamically based on a list of given cols.
      * The function is called from the {@link Lada.controller.Filter#search
      * search event}
+     * The Images for the Read-Write Icon are defined in CSS
      */
     setupColumns: function(cols) {
         var resultColumns = [];
@@ -136,16 +137,19 @@
         }));
 
         resultColumns.push({
-            header: 'RW',
+            xtype: 'actioncolumn',
+            text: 'RW',
             dataIndex: 'readonly',
             sortable: false,
+            tooltip: 'Probe öffnen',
             width: 30,
-            renderer: function(value, meta, record) {
-                if ( !value && record.get('owner')) {
-                    return '<img src="resources/img/view-time-schedule-edit.png"/>';
-                }
-                return '<img src="resources/img/view-time-schedule-baselined.png"/>';
-            }
+            getClass: function (val, meta, rec) {
+                return rec.get('readonly') === false ? "edit" : "noedit";
+            },
+            handler: function(grid, rowIndex, colIndex) {
+                var rec = grid.getStore().getAt(rowIndex);
+                grid.fireEvent('itemdblclick', grid, rec);
+             }
         });
 
         for (var i = cols.length - 1; i >= 0; i--) {
@@ -162,7 +166,7 @@
             // TODO: Might need to be extended to Messprogramme
             resultColumns.push({
                 xtype: 'actioncolumn',
-                header: 'Aktionen',
+                text: 'Aktion',
                 sortable: false,
                 width: 30,
                 items: [{
--- a/resources/css/lada.css	Fri Jul 17 15:24:27 2015 +0200
+++ b/resources/css/lada.css	Fri Jul 17 15:44:51 2015 +0200
@@ -16,6 +16,25 @@
 
 .window-inactive .x-window-header-text {color: #a9a9a9;}
 
+
+.x-action-col-cell img
+{
+  cursor: pointer;
+  background-repeat: no-repeat;
+  background-position: center;
+}
+
+.x-action-col-cell img.noedit
+{
+  background-image: url(/resources/img/view-time-schedule-baselined.png);
+}
+
+.x-action-col-cell img.edit
+{
+  background-image: url(/resources/img/view-time-schedule-edit.png);
+}
+
+
 /* do not display clear-button (x) in IE10+ Input fields */
 ::-ms-clear {
    display: none;

http://lada.wald.intevation.org