[Lada-commits] [PATCH 1 of 2] Display a Title in the Toolbar

Wald Commits scm-commit at wald.intevation.org
Tue May 5 17:23:18 CEST 2015


# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1430305464 -7200
# Node ID 4dd0c645ea8b22449c56472c6e53b4c1e0779d88
# Parent  639e82e2089e8c1743cf1205d524c98c0d4b5fdc
Display a Title in the Toolbar

diff -r 639e82e2089e -r 4dd0c645ea8b app/view/grid/FilterResult.js
--- a/app/view/grid/FilterResult.js	Tue Apr 28 16:54:25 2015 +0200
+++ b/app/view/grid/FilterResult.js	Wed Apr 29 13:04:24 2015 +0200
@@ -18,7 +18,7 @@
     multiSelect: true,
 
     viewConfig: {
-        emptyText: 'Keine Proben gefunden.',
+        emptyText: 'Keine Ergebnisse gefunden.',
         deferEmptyText: false
     },
 
@@ -27,18 +27,31 @@
             xtype: 'toolbar',
             dock: 'top',
             items: [{
-                text: 'Hinzufügen',
+                xtype: 'tbtext',
+                id: 'tbtitle',
+                text: '',
+            },
+            '->',
+            {
+                text: 'Probe erstellen',
                 icon: 'resources/img/list-add.png',
-                action: 'add'
+                action: 'addProbe'
             }, {
-                text: 'Import',
+                text: 'Messprogramm erstellen',
+                icon: 'resources/img/list-add.png',
+                action: 'addProbe'
+            },
+            '-',
+            {
+                text: 'Proben Importieren',
                 icon: 'resources/img/svn-commit.png',
                 action: 'import'
             }, {
-                text: 'Export',
+                text: 'Proben Exportieren',
                 icon: 'resources/img/svn-update.png',
                 action: 'export'
-            }]
+            }
+            ]
         }];
         this.columns = [];
         this.callParent(arguments);
@@ -48,6 +61,8 @@
      * This sets the Store of the FilterResultGrid
      */
     setStore: function(store){
+        var i18n = Lada.getApplication().bundle;
+
         this.removeDocked(Ext.getCmp('ptbar'), true);
         this.reconfigure(store);
         this.addDocked([{
@@ -57,6 +72,21 @@
             store: store,
             displayInfo: true
         }]);
+
+        //Reset the Text int the Toolbar.
+        var t = Ext.getCmp('tbtitle');
+        if (store.model.modelName == 'Lada.model.MessprogrammList') {
+            t.setText(i18n.getMsg('probeplanning'));
+        }
+        else if (store.model.modelName == 'Lada.model.ProbeList') {
+            t.setText(i18n.getMsg('probelist'));
+        }
+        else {
+            t.setText('');
+            console.log('The model '+store.model.modelName+
+                'was not defined in the FilterResultGrid.' +
+                ' Hence the title could not be set.');
+        }
     },
     /**
      * Setup columns of the Grid dynamically based on a list of given cols.


More information about the Lada-commits mailing list