Mercurial > lada > lada-client
comparison app/controller/Kommentare.js @ 490:446e99cfd425
Updated views and controllers using the new model and stores.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 31 Oct 2014 21:28:31 +0100 |
parents | debfcc7713e3 |
children | 850ccfe5f3c4 |
comparison
equal
deleted
inserted
replaced
489:6056a7fd9aa2 | 490:446e99cfd425 |
---|---|
13 extend: 'Lada.controller.Base', | 13 extend: 'Lada.controller.Base', |
14 views: [ | 14 views: [ |
15 'kommentare.Create' | 15 'kommentare.Create' |
16 ], | 16 ], |
17 stores: [ | 17 stores: [ |
18 'Kommentare' | 18 'KommentareP' |
19 ], | 19 ], |
20 models: [ | 20 models: [ |
21 'Kommentar' | 21 'KommentarP' |
22 ], | 22 ], |
23 init: function() { | 23 init: function() { |
24 console.log('Initialising the Kommentare controller'); | 24 console.log('Initialising the Kommentare controller'); |
25 this.callParent(); | 25 this.callParent(); |
26 }, | 26 }, |
44 } | 44 } |
45 }); | 45 }); |
46 }, | 46 }, |
47 addItem: function(button) { | 47 addItem: function(button) { |
48 console.log('Adding new Kommentar for Probe ' + button.probeId); | 48 console.log('Adding new Kommentar for Probe ' + button.probeId); |
49 var kommentar = Ext.create('Lada.model.Kommentar'); | 49 var kommentar = Ext.create('Lada.model.KommentarP'); |
50 kommentar.set('probeId', button.probeId); | 50 kommentar.set('probeId', button.probeId); |
51 var view = Ext.widget('kommentarecreate', {model: kommentar}); | 51 var view = Ext.widget('kommentarecreate', {model: kommentar}); |
52 }, | 52 }, |
53 editItem: function(grid, record) { | 53 editItem: function(grid, record) { |
54 console.log('Editing Kommentar'); | 54 console.log('Editing Kommentar'); |
62 var form = view.down('form'); | 62 var form = view.down('form'); |
63 form.setReadOnly(true, ignore); | 63 form.setReadOnly(true, ignore); |
64 } | 64 } |
65 }, | 65 }, |
66 createSuccess: function(form, record, operation) { | 66 createSuccess: function(form, record, operation) { |
67 var store = this.getKommentareStore(); | 67 var store = this.getKommentarePStore(); |
68 store.reload(); | 68 store.reload(); |
69 var win = form.up('window'); | 69 var win = form.up('window'); |
70 win.close(); | 70 win.close(); |
71 } | 71 } |
72 }); | 72 }); |