[Lada-commits] [PATCH 6 of 6] 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

Wald Commits scm-commit at wald.intevation.org
Fri Jul 17 15:54:59 CEST 2015


# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1437140691 -7200
# Node ID 545b8913601d72b0e1632d26c3bd7167fba68552
# Parent  a58c006f869c7cd5e34795ef456e8fc3af00e9f8
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.

diff -r a58c006f869c -r 545b8913601d app/view/grid/FilterResult.js
--- 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: [{
diff -r a58c006f869c -r 545b8913601d resources/css/lada.css
--- 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;


More information about the Lada-commits mailing list