comparison app/controller/Base.js @ 286:c509e9f6d4db

Added BaseController and inherit Kommentar controller from it.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Fri, 09 Aug 2013 14:21:08 +0200
parents
children 12e7f0ef90b6
comparison
equal deleted inserted replaced
285:6c030e5739a7 286:c509e9f6d4db
1 /**
2 * Base Controller
3 *
4 * The controller defines the main logic of the application. It provides
5 * various methods which are bound to listeners and called when the defined
6 * events in the various UI elements occour (e.g User clicks on a button)
7 */
8 Ext.define('Lada.controller.Base', {
9 extend: 'Ext.app.Controller',
10 /**
11 * Define required views for this controller
12 */
13 views: [],
14 /**
15 * Define required stores for this controller
16 */
17 stores: [],
18 /**
19 * Define required models for this controller
20 */
21 models: [],
22 init: function() {
23 console.log('Initialising the Kommentare controller');
24 this.addListeners();
25 },
26 /**
27 * Function to add listeners for various events in UI items. The UI Items are selected
28 * with a CSS like selector.See ComponentQuery documentation for more
29 * details. The function is called while initializing the controller.
30 *
31 * The function should be overwritten by a specfic implementation.
32 */
33 addListeners: function() {
34 this.control({});
35 },
36 /**
37 * Method to save the kommentar in the database. The method is called when
38 * the user clicks on the "Save" button
39 */
40 saveItem: function(button) {},
41 /**
42 * Method to open a window to enter the values for a new kommentar.
43 * The method is called when the user clicks on the "Add" button in the
44 * grid toolbar.
45 */
46 addItem: function(button) {},
47 /**
48 * Method to open a window to edit the values for an existing kommentar.
49 * The method is called when the user doubleclicks on the item in the
50 * grid.
51 */
52 editItem: function(grid, record) {},
53 /**
54 * Method to delete a kommentar. This will trigger the display of a
55 * Confirmation dialog. After the deletion the related store will be
56 * refreshed.
57 * The method is called when the user selects the item in the grid and
58 * selects the delete button in the grid toolbar.
59 */
60 deleteItem: function(button) {},
61 /**
62 * Method to trigger the action after successfull save (create or edit).
63 * In this case the related store is refreshed and the window is closed.
64 */
65 createSuccess: function(form, record, operation) {},
66 /**
67 * Method to trigger the action after save (create or edit) fails.
68 * In this case a Message Boss with a general error is shown.
69 */
70 createFailure: function(form, record, operation) {}
71 });

http://lada.wald.intevation.org