Mercurial > lada > lada-client
comparison app/controller/Kommentare.js @ 61:20a4f9aaecde
Removed old code.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Wed, 29 May 2013 16:07:11 +0200 |
parents | 5db7ab34af6d |
children | 84f32c62670f |
comparison
equal
deleted
inserted
replaced
60:5db7ab34af6d | 61:20a4f9aaecde |
---|---|
26 click: this.deleteKommentar | 26 click: this.deleteKommentar |
27 }, | 27 }, |
28 'kommentaredit button[action=save]': { | 28 'kommentaredit button[action=save]': { |
29 click: this.saveKommentar | 29 click: this.saveKommentar |
30 } | 30 } |
31 //'probenedit button[action=save]': { | |
32 // click: this.updateProbe | |
33 //} | |
34 }); | 31 }); |
35 }, | 32 }, |
36 addKommentar: function(button) { | 33 addKommentar: function(button) { |
37 console.log('Adding new Kommentar'); | 34 console.log('Adding new Kommentar'); |
38 var view = Ext.widget('kommentaredit'); | 35 var view = Ext.widget('kommentaredit'); |
43 }, | 40 }, |
44 deleteKommentar: function(button) { | 41 deleteKommentar: function(button) { |
45 // Get selected item in grid | 42 // Get selected item in grid |
46 var grid = button.up('grid'); | 43 var grid = button.up('grid'); |
47 var selection = grid.getView().getSelectionModel().getSelection()[0]; | 44 var selection = grid.getView().getSelectionModel().getSelection()[0]; |
48 console.log("Searching grid"); | |
49 Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){ | 45 Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){ |
50 if(btn === 'yes'){ | 46 if(btn === 'yes'){ |
51 var store = grid.getStore(); | 47 var store = grid.getStore(); |
52 store.remove(selection); | 48 store.remove(selection); |
53 store.sync(); | 49 store.sync(); |
56 console.log('Cancel Deleting Kommentar'); | 52 console.log('Cancel Deleting Kommentar'); |
57 } | 53 } |
58 }); | 54 }); |
59 }, | 55 }, |
60 editKommentar: function(grid, record) { | 56 editKommentar: function(grid, record) { |
61 console.log('Double click on ' + record.get('id')); | |
62 // Create new window to edit the seletced record. | 57 // Create new window to edit the seletced record. |
63 var view = Ext.widget('kommentaredit'); | 58 var view = Ext.widget('kommentaredit'); |
64 var form = view.down('form'); | 59 var form = view.down('form'); |
65 form.loadRecord(record); | 60 form.loadRecord(record); |
66 }, | 61 }, |
67 updateKommentar: function(button) { | |
68 //console.log('Click save'); | |
69 //// We only have a reference to the button here but we really wnat to | |
70 //// get the form and the window. So first get the window and form and | |
71 //// the the record an values. | |
72 //var win = button.up('window'); | |
73 //var form = win.down('form'); | |
74 //var record = form.getRecord(); | |
75 //var values = form.getValues(); | |
76 | |
77 //record.set(values); | |
78 //win.close(); | |
79 //// synchronize the store after editing the record | |
80 //// NOTE: The function 'getProbenStore' will be generated | |
81 //// dynamically based on the Name of the configured Store!!! | |
82 //this.getProbenStore().sync(); | |
83 saveKommentar: function(button) { | 62 saveKommentar: function(button) { |
84 var win = button.up('window'); | 63 var win = button.up('window'); |
85 var form = win.down('form'); | 64 var form = win.down('form'); |
86 var record = form.getRecord(); | 65 var record = form.getRecord(); |
87 var values = form.getValues(); | 66 var values = form.getValues(); |