annotate app/controller/Proben.js @ 91:95b08b96f5c9

Added new widget for the netzbetreiber.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 11 Jun 2013 15:04:18 +0200
parents eb40b74f871a
children 21c069e2ecdb
rev   line source
1
af8d7217521d Added basic Proben controller.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
1 Ext.define('Lada.controller.Proben', {
af8d7217521d Added basic Proben controller.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
2 extend: 'Ext.app.Controller',
4
b8e56e880f02 Added a first example view (userlisting) from the EXJS Tutorial. Need to be
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 1
diff changeset
3 views: [
18
9e1a40312bbe Implemented a basic edit dialog. Data will be set to data/proben2.json url
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 13
diff changeset
4 'proben.List',
65
9e2e09e819fd Added a new Dialog to create proben without any kommentare or other additional
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 64
diff changeset
5 'proben.Edit',
9e2e09e819fd Added a new Dialog to create proben without any kommentare or other additional
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 64
diff changeset
6 'proben.Create'
4
b8e56e880f02 Added a first example view (userlisting) from the EXJS Tutorial. Need to be
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 1
diff changeset
7 ],
13
a8efc4b96888 Added model for Proben and a Store.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 5
diff changeset
8 stores: [
40
f9b6de636ad0 Added probenart combobox
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 18
diff changeset
9 'Proben',
42
5ed477590736 Added missiong code for uwb.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 41
diff changeset
10 'Uwb',
41
a1be7ccd4d0c Added datenbasis combobox
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 40
diff changeset
11 'Datenbasis',
46
39f5f1529847 Added combotbox for Betriebsart.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 42
diff changeset
12 'Probenart',
49
792c34b3f5a9 Added combobox for field "testdatensatz"
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 46
diff changeset
13 'Betriebsart',
91
95b08b96f5c9 Added new widget for the netzbetreiber.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 86
diff changeset
14 'Netzbetreiber',
54
3c7bfff8bd64 Added Controller for kommentare
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 53
diff changeset
15 'Testdatensatz'
13
a8efc4b96888 Added model for Proben and a Store.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 5
diff changeset
16 ],
a8efc4b96888 Added model for Proben and a Store.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 5
diff changeset
17 models: [
a8efc4b96888 Added model for Proben and a Store.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 5
diff changeset
18 'Probe'
a8efc4b96888 Added model for Proben and a Store.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 5
diff changeset
19 ],
1
af8d7217521d Added basic Proben controller.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
20 init: function() {
af8d7217521d Added basic Proben controller.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
21 console.log('Initialising the Proben controller');
af8d7217521d Added basic Proben controller.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
22 this.control({
af8d7217521d Added basic Proben controller.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
23 // CSS like selector to select element in the viewport. See
af8d7217521d Added basic Proben controller.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
24 // ComponentQuery documentation for more details.
18
9e1a40312bbe Implemented a basic edit dialog. Data will be set to data/proben2.json url
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 13
diff changeset
25 'probenlist': {
5
039584709fa7 Map double click event on rows of the userlist to the editProben function.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 4
diff changeset
26 itemdblclick: this.editProbe
18
9e1a40312bbe Implemented a basic edit dialog. Data will be set to data/proben2.json url
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 13
diff changeset
27 },
64
a4a24e737deb Added listener to open a new window to enter data fpr the new probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 54
diff changeset
28 'probenlist toolbar button[action=add]': {
a4a24e737deb Added listener to open a new window to enter data fpr the new probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 54
diff changeset
29 click: this.addProbe
a4a24e737deb Added listener to open a new window to enter data fpr the new probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 54
diff changeset
30 },
70
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
31 'probencreate form': {
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
32 savesuccess: this.createSuccess,
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
33 savefailure: this.createFailure
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
34 },
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
35 'probenedit form': {
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
36 savesuccess: this.editSuccess,
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
37 savefailure: this.editFailure
1
af8d7217521d Added basic Proben controller.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
38 }
af8d7217521d Added basic Proben controller.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
39 });
af8d7217521d Added basic Proben controller.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
40 },
64
a4a24e737deb Added listener to open a new window to enter data fpr the new probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 54
diff changeset
41 addProbe: function(button) {
71
db26aeebe521 Added new Form for editing proben. Use this form in the edit window.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 70
diff changeset
42 console.log('Adding new Probe');
65
9e2e09e819fd Added a new Dialog to create proben without any kommentare or other additional
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 64
diff changeset
43 var view = Ext.widget('probencreate');
64
a4a24e737deb Added listener to open a new window to enter data fpr the new probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 54
diff changeset
44 },
5
039584709fa7 Map double click event on rows of the userlist to the editProben function.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 4
diff changeset
45 editProbe: function(grid, record) {
71
db26aeebe521 Added new Form for editing proben. Use this form in the edit window.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 70
diff changeset
46 console.log('Editing Probe');
db26aeebe521 Added new Form for editing proben. Use this form in the edit window.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 70
diff changeset
47 var id = record.get('probeId');
db26aeebe521 Added new Form for editing proben. Use this form in the edit window.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 70
diff changeset
48 var view = Ext.widget('probenedit', {modelId: id});
db26aeebe521 Added new Form for editing proben. Use this form in the edit window.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 70
diff changeset
49 console.log("Loaded Probe with ID " + record.getId()); //outputs ID
18
9e1a40312bbe Implemented a basic edit dialog. Data will be set to data/proben2.json url
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 13
diff changeset
50 },
69
cb1138f5cea7 Removed old code
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 65
diff changeset
51 createSuccess: function(form, record, operation) {
86
eb40b74f871a Reload the store after the probe was created or edited.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 76
diff changeset
52 // Reload store
eb40b74f871a Reload the store after the probe was created or edited.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 76
diff changeset
53 var store = this.getProbenStore();
eb40b74f871a Reload the store after the probe was created or edited.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 76
diff changeset
54 store.reload();
69
cb1138f5cea7 Removed old code
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 65
diff changeset
55 var win = form.up('window');
18
9e1a40312bbe Implemented a basic edit dialog. Data will be set to data/proben2.json url
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 13
diff changeset
56 win.close();
70
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
57 },
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
58 createFailure: function(form, record, operation) {
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
59 Ext.MessageBox.show({
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
60 title: 'Fehler beim Speichern',
76
eb8a7d3cca89 Use translated message from server in error dialog
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 71
diff changeset
61 msg: form.message,
70
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
62 icon: Ext.MessageBox.ERROR,
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
63 buttons: Ext.Msg.OK
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
64 });
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
65 },
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
66 editSuccess: function(form, record, operation) {
86
eb40b74f871a Reload the store after the probe was created or edited.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 76
diff changeset
67 // Reload store
eb40b74f871a Reload the store after the probe was created or edited.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 76
diff changeset
68 var store = this.getProbenStore();
eb40b74f871a Reload the store after the probe was created or edited.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 76
diff changeset
69 store.reload();
70
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
70 var win = form.up('window');
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
71 win.close();
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
72 },
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
73 editFailure: function(form, record, operation) {
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
74 Ext.MessageBox.show({
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
75 title: 'Fehler beim Speichern',
76
eb8a7d3cca89 Use translated message from server in error dialog
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 71
diff changeset
76 msg: form.message,
70
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
77 icon: Ext.MessageBox.ERROR,
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
78 buttons: Ext.Msg.OK
1a943947a7d2 Added new listeners for events comming from the Probenforms.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 69
diff changeset
79 });
1
af8d7217521d Added basic Proben controller.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
80 }
af8d7217521d Added basic Proben controller.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
81 });

http://lada.wald.intevation.org