diff app/view/widget/DynamicGrid.js @ 1259:bfdd875cdb5f

Add tooltip to DynamicGrid
author Evi Huber <ehuber@bfs.de>
date Fri, 25 Nov 2016 13:21:24 +0100
parents 4270da0f7d3b
children 96f9417c105e
line wrap: on
line diff
--- 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);
              }
         });

http://lada.wald.intevation.org