Mercurial > lada > lada-client
comparison app/controller/Kommentare.js @ 107:84f32c62670f
Added form to create kommentare
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Wed, 19 Jun 2013 11:43:25 +0200 |
parents | 20a4f9aaecde |
children | 6273b73b4b27 |
comparison
equal
deleted
inserted
replaced
106:b91d5376db19 | 107:84f32c62670f |
---|---|
1 Ext.define('Lada.controller.Kommentare', { | 1 Ext.define('Lada.controller.Kommentare', { |
2 extend: 'Ext.app.Controller', | 2 extend: 'Ext.app.Controller', |
3 views: [ | 3 views: [ |
4 'kommentare.List', | 4 'kommentare.List', |
5 'kommentare.Edit' | 5 'kommentare.Edit', |
6 'kommentare.Create' | |
6 ], | 7 ], |
7 stores: [ | 8 stores: [ |
8 'Kommentare' | 9 'Kommentare' |
9 ], | 10 ], |
10 models: [ | 11 models: [ |
30 } | 31 } |
31 }); | 32 }); |
32 }, | 33 }, |
33 addKommentar: function(button) { | 34 addKommentar: function(button) { |
34 console.log('Adding new Kommentar'); | 35 console.log('Adding new Kommentar'); |
35 var view = Ext.widget('kommentaredit'); | 36 var view = Ext.create('Lada.view.kommentare.Create'); |
36 var form = view.down('form'); | 37 var form = view.down('form'); |
37 // Create a new Kommentar | 38 // Set probeId |
38 var record = Ext.create('Lada.model.Kommentar'); | 39 var probenform = button.up('form'); |
39 form.loadRecord(record); | 40 var probe = probenform.getRecord(); |
41 var probeId = probe.get('probeId'); | |
42 form.model.set('probeId', probeId); | |
40 }, | 43 }, |
41 deleteKommentar: function(button) { | 44 deleteKommentar: function(button) { |
42 // Get selected item in grid | 45 // Get selected item in grid |
43 var grid = button.up('grid'); | 46 var grid = button.up('grid'); |
44 var selection = grid.getView().getSelectionModel().getSelection()[0]; | 47 var selection = grid.getView().getSelectionModel().getSelection()[0]; |