Mercurial > lada > lada-client
comparison app/controller/Base.js @ 491:850ccfe5f3c4
Code style.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 31 Oct 2014 23:23:32 +0100 |
parents | 446e99cfd425 |
children | 7c0653e8d9f7 |
comparison
equal
deleted
inserted
replaced
490:446e99cfd425 | 491:850ccfe5f3c4 |
---|---|
26 /** | 26 /** |
27 * Define required models for this controller | 27 * Define required models for this controller |
28 */ | 28 */ |
29 models: [], | 29 models: [], |
30 init: function() { | 30 init: function() { |
31 console.log('Initialising the Kommentare controller'); | |
32 this.addListeners(); | 31 this.addListeners(); |
33 }, | 32 }, |
34 /** | 33 /** |
35 * Function to add listeners for various events in UI items. The UI Items are selected | 34 * Function to add listeners for various events in UI items. The UI Items are selected |
36 * with a CSS like selector.See ComponentQuery documentation for more | 35 * with a CSS like selector.See ComponentQuery documentation for more |
70 * selects the delete button in the grid toolbar. | 69 * selects the delete button in the grid toolbar. |
71 */ | 70 */ |
72 deleteItem: function(button) { | 71 deleteItem: function(button) { |
73 var grid = button.up('grid'); | 72 var grid = button.up('grid'); |
74 var selection = grid.getView().getSelectionModel().getSelection()[0]; | 73 var selection = grid.getView().getSelectionModel().getSelection()[0]; |
75 Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn){ | 74 Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn) { |
76 if(btn === 'yes'){ | 75 if (btn === 'yes') { |
77 var store = grid.getStore(); | 76 var store = grid.getStore(); |
78 var deleteUrl = selection.getProxy().url + selection.getId(); | 77 var deleteUrl = selection.getProxy().url + selection.getId(); |
79 Ext.Ajax.request({ | 78 Ext.Ajax.request({ |
80 url: deleteUrl, | 79 url: deleteUrl, |
81 method: 'DELETE', | 80 method: 'DELETE', |