comparison app/view/grid/FilterResult.js @ 753:4dd0c645ea8b

Display a Title in the Toolbar
author Dustin Demuth <dustin@intevation.de>
date Wed, 29 Apr 2015 13:04:24 +0200
parents 704bb359c0fe
children 3637c453f67d
comparison
equal deleted inserted replaced
752:639e82e2089e 753:4dd0c645ea8b
16 store: null, //'ProbenList', 16 store: null, //'ProbenList',
17 17
18 multiSelect: true, 18 multiSelect: true,
19 19
20 viewConfig: { 20 viewConfig: {
21 emptyText: 'Keine Proben gefunden.', 21 emptyText: 'Keine Ergebnisse gefunden.',
22 deferEmptyText: false 22 deferEmptyText: false
23 }, 23 },
24 24
25 initComponent: function() { 25 initComponent: function() {
26 this.dockedItems = [{ 26 this.dockedItems = [{
27 xtype: 'toolbar', 27 xtype: 'toolbar',
28 dock: 'top', 28 dock: 'top',
29 items: [{ 29 items: [{
30 text: 'Hinzufügen', 30 xtype: 'tbtext',
31 id: 'tbtitle',
32 text: '',
33 },
34 '->',
35 {
36 text: 'Probe erstellen',
31 icon: 'resources/img/list-add.png', 37 icon: 'resources/img/list-add.png',
32 action: 'add' 38 action: 'addProbe'
33 }, { 39 }, {
34 text: 'Import', 40 text: 'Messprogramm erstellen',
41 icon: 'resources/img/list-add.png',
42 action: 'addProbe'
43 },
44 '-',
45 {
46 text: 'Proben Importieren',
35 icon: 'resources/img/svn-commit.png', 47 icon: 'resources/img/svn-commit.png',
36 action: 'import' 48 action: 'import'
37 }, { 49 }, {
38 text: 'Export', 50 text: 'Proben Exportieren',
39 icon: 'resources/img/svn-update.png', 51 icon: 'resources/img/svn-update.png',
40 action: 'export' 52 action: 'export'
41 }] 53 }
54 ]
42 }]; 55 }];
43 this.columns = []; 56 this.columns = [];
44 this.callParent(arguments); 57 this.callParent(arguments);
45 }, 58 },
46 59
47 /** 60 /**
48 * This sets the Store of the FilterResultGrid 61 * This sets the Store of the FilterResultGrid
49 */ 62 */
50 setStore: function(store){ 63 setStore: function(store){
64 var i18n = Lada.getApplication().bundle;
65
51 this.removeDocked(Ext.getCmp('ptbar'), true); 66 this.removeDocked(Ext.getCmp('ptbar'), true);
52 this.reconfigure(store); 67 this.reconfigure(store);
53 this.addDocked([{ 68 this.addDocked([{
54 xtype: 'pagingtoolbar', 69 xtype: 'pagingtoolbar',
55 id: 'ptbar', 70 id: 'ptbar',
56 dock: 'bottom', 71 dock: 'bottom',
57 store: store, 72 store: store,
58 displayInfo: true 73 displayInfo: true
59 }]); 74 }]);
75
76 //Reset the Text int the Toolbar.
77 var t = Ext.getCmp('tbtitle');
78 if (store.model.modelName == 'Lada.model.MessprogrammList') {
79 t.setText(i18n.getMsg('probeplanning'));
80 }
81 else if (store.model.modelName == 'Lada.model.ProbeList') {
82 t.setText(i18n.getMsg('probelist'));
83 }
84 else {
85 t.setText('');
86 console.log('The model '+store.model.modelName+
87 'was not defined in the FilterResultGrid.' +
88 ' Hence the title could not be set.');
89 }
60 }, 90 },
61 /** 91 /**
62 * Setup columns of the Grid dynamically based on a list of given cols. 92 * Setup columns of the Grid dynamically based on a list of given cols.
63 * The function is called from the {@link Lada.controller.Sql#selectSql 93 * The function is called from the {@link Lada.controller.Sql#selectSql
64 * select sql event} 94 * select sql event}

http://lada.wald.intevation.org