Mercurial > lada > lada-client
comparison app/view/grid/Orte.js @ 1021:1df6b6210b42 stammdatengrids
WIP First Version of a New Window/Panel combination to edit Ortszuordnungen and Orte
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Thu, 04 Feb 2016 16:31:46 +0100 |
parents | 6afdbc8ee920 |
children | 1bd4c0709bd6 |
comparison
equal
deleted
inserted
replaced
1014:e9e974d31924 | 1021:1df6b6210b42 |
---|---|
29 | 29 |
30 initComponent: function() { | 30 initComponent: function() { |
31 var i18n = Lada.getApplication().bundle; | 31 var i18n = Lada.getApplication().bundle; |
32 this.emptyText = i18n.getMsg('orte.emptyGrid'); | 32 this.emptyText = i18n.getMsg('orte.emptyGrid'); |
33 | 33 |
34 this.dockedItems = [{ | |
35 xtype: 'toolbar', | |
36 dock: 'top', | |
37 items: [{ | |
38 xtype: 'tbtext', | |
39 id: 'tbtitle', | |
40 text: i18n.getMsg('orte.gridTitle') | |
41 }, | |
42 '->', | |
43 { | |
44 text: i18n.getMsg('orte.button.add'), | |
45 icon: 'resources/img/list-add.png', | |
46 action: 'add', | |
47 disabled: true // disabled on startup, will be enabled by setStore | |
48 }, { | |
49 text: i18n.getMsg('orte.button.delete'), | |
50 icon: 'resources/img/list-remove.png', | |
51 action: 'delete', | |
52 disabled: true // disabled on startup, will be enabled by controller if necessary | |
53 }] | |
54 }]; | |
55 this.columns = [{ | 34 this.columns = [{ |
56 header: i18n.getMsg('orte.ortId'), | 35 header: i18n.getMsg('orte.ortId'), |
57 dataIndex: 'ortId' | 36 dataIndex: 'ortId' |
58 }, { | 37 }, { |
59 header: i18n.getMsg('orte.nutsCode'), | 38 header: i18n.getMsg('orte.nutsCode'), |
142 */ | 121 */ |
143 setStore: function(store){ | 122 setStore: function(store){ |
144 var i18n = Lada.getApplication().bundle; | 123 var i18n = Lada.getApplication().bundle; |
145 | 124 |
146 if (store) { | 125 if (store) { |
147 this.removeDocked(Ext.getCmp('ptbar'), true); | |
148 this.reconfigure(store); | 126 this.reconfigure(store); |
149 this.down('button[action=add]').enable(); | 127 |
150 this.addDocked([{ | 128 var ptbar = this.down('pagingtoolbar'); |
151 xtype: 'pagingtoolbar', | 129 if (ptbar) { |
152 id: 'ptbar', | 130 this.removeDocked(ptbar); |
153 dock: 'bottom', | 131 } |
154 store: store, | 132 |
155 displayInfo: true | 133 if (store.pageSize > 0) { |
156 }]); | 134 this.addDocked([{ |
135 xtype: 'pagingtoolbar', | |
136 dock: 'bottom', | |
137 store: store, | |
138 displayInfo: true | |
139 }]); | |
140 } | |
157 } | 141 } |
158 } | 142 } |
159 }); | 143 }); |