[Lada-commits] [PATCH] Add tooltip to DynamicGrid

Wald Commits scm-commit at wald.intevation.org
Fri Nov 25 13:21:30 CET 2016


# HG changeset patch
# User Evi Huber <ehuber at bfs.de>
# Date 1480076484 -3600
# Node ID bfdd875cdb5f090cb09943d3affa36d547f8078f
# Parent  835042fa1a1d1e98829a7504dd134fb40e1b01c5
Add tooltip to DynamicGrid

diff -r 835042fa1a1d -r bfdd875cdb5f app/view/widget/DynamicGrid.js
--- a/app/view/widget/DynamicGrid.js	Fri Nov 25 10:45:45 2016 +0100
+++ b/app/view/widget/DynamicGrid.js	Fri Nov 25 13:21:24 2016 +0100
@@ -34,7 +34,6 @@
      */
     setStore: function(store){
         var i18n = Lada.getApplication().bundle;
-
         this.reconfigure(store);
         var ptbar = this.down('pagingtoolbar');
         if (ptbar) {
@@ -73,6 +72,17 @@
     generateColumnsAndFields: function(cols) {
         var resultColumns = [];
         var fields = [];
+        var i18n = Lada.getApplication().bundle;
+        switch(this.xtype) {
+            case 'probelistgrid':
+                var tooltiptext = i18n.getMsg('probe')+' '+i18n.getMsg('open');
+                break;
+            case 'messunglistgrid':
+                var tooltiptext = i18n.getMsg('messung')+' '+i18n.getMsg('open');
+                break;
+            case 'messprogrammelistgrid':
+                var tooltiptext = i18n.getMsg('messprogramm')+' '+i18n.getMsg('open');
+        }
 
         fields.push(new Ext.data.Field({
             name: 'owner'
@@ -92,7 +102,7 @@
             text: 'RW',
             dataIndex: 'readonly',
             sortable: false,
-            tooltip: 'Probe öffnen',
+            tooltip: tooltiptext,
             width: 30,
             getClass: function (val, meta, rec) {
                 if (rec.get('readonly') === false &&
@@ -113,6 +123,7 @@
             },
             handler: function(grid, rowIndex, colIndex) {
                 var rec = grid.getStore().getAt(rowIndex);
+                var tooltext = rec.proxy.url;
                 grid.fireEvent('itemdblclick', grid, rec);
              }
         });
diff -r 835042fa1a1d -r bfdd875cdb5f resources/i18n/Lada_de-DE.properties
--- a/resources/i18n/Lada_de-DE.properties	Fri Nov 25 10:45:45 2016 +0100
+++ b/resources/i18n/Lada_de-DE.properties	Fri Nov 25 13:21:24 2016 +0100
@@ -61,6 +61,7 @@
 
 probe:Probe
 messung:Messung
+messprogramm:Messprogramm
 name:Name
 mprId:Mpr-Id
 mstId:Messstelle
@@ -340,3 +341,8 @@
 
 statusSetzen:Status setzen
 statusSetzen.win.title:Status setzen
+
+##
+# Action
+##
+open:öffnen


More information about the Lada-commits mailing list