changeset 753:4dd0c645ea8b

Display a Title in the Toolbar
author Dustin Demuth <dustin@intevation.de>
date Wed, 29 Apr 2015 13:04:24 +0200
parents 639e82e2089e
children 6b0d0e62f7d7
files app/view/grid/FilterResult.js
diffstat 1 files changed, 36 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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.

http://lada.wald.intevation.org