comparison app/controller/Orte.js @ 149:26ac4c99f8c4

Added Orte.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Mon, 01 Jul 2013 17:05:03 +0200
parents 2308094f5a8c
children 16ba7e2465fd
comparison
equal deleted inserted replaced
148:ed7fb4fa32dc 149:26ac4c99f8c4
3 views: [ 3 views: [
4 'orte.List', 4 'orte.List',
5 'orte.Create' 5 'orte.Create'
6 ], 6 ],
7 stores: [ 7 stores: [
8 'Orte',
9 'Ortedetails',
10 'Staaten',
11 'Verwaltungseinheiten'
8 ], 12 ],
9 models: [ 13 models: [
10 'Ort' 14 'Ort'
11 ], 15 ],
12 init: function() { 16 init: function() {
21 click: this.addOrt 25 click: this.addOrt
22 }, 26 },
23 'ortelist toolbar button[action=delete]': { 27 'ortelist toolbar button[action=delete]': {
24 click: this.deleteOrt 28 click: this.deleteOrt
25 }, 29 },
30 'ortecreate button[action=save]': {
31 click: this.saveOrt
32 },
26 'ortecreate form': { 33 'ortecreate form': {
27 savesuccess: this.createSuccess, 34 savesuccess: this.createSuccess,
28 savefailure: this.createFailure 35 savefailure: this.createFailure
29 }, 36 },
30 'orteedit form': { 37 'orteedit form': {
31 savesuccess: this.editSuccess, 38 savesuccess: this.editSuccess,
32 savefailure: this.editFailure 39 savefailure: this.editFailure
33 } 40 }
34 }); 41 });
35 }, 42 },
43 saveOrt: function(button) {
44 console.log('Saving Ort');
45 var form = button.up('window').down('form');
46 form.commit();
47 },
36 addOrt: function(button) { 48 addOrt: function(button) {
37 console.log('Adding new Ort'); 49 console.log('Adding new Ort for Probe ' + button.probeId);
38 var view = Ext.widget('ortecreate'); 50 var ort = Ext.create('Lada.model.Ort');
51 ort.set('probeId', button.probeId);
52 var view = Ext.widget('ortecreate', {model: ort});
39 }, 53 },
40 editOrt: function(grid, record) { 54 editOrt: function(grid, record) {
41 console.log('Editing Ort'); 55 console.log('Editing Ort');
42 var view = Ext.widget('ortecreate', {model: record}); 56 var view = Ext.widget('ortecreate', {model: record});
43 console.log("Loaded Ort with ID " + record.getId()); //outputs ID 57 console.log("Loaded Ort with ID " + record.getId()); //outputs ID

http://lada.wald.intevation.org