comparison app/controller/Orte.js @ 216:6aedf2026fb4

Fixed issue23
author Torsten Irländer <torsten.irlaender@intevation.de>
date Mon, 15 Jul 2013 15:30:52 +0200
parents 19d79b41f95d
children 4db982514a5f
comparison
equal deleted inserted replaced
215:19d79b41f95d 216:6aedf2026fb4
47 47
48 var ortdetail = null; 48 var ortdetail = null;
49 var ortdetailstore = Ext.getStore('Ortedetails'); 49 var ortdetailstore = Ext.getStore('Ortedetails');
50 var newortdetail = false; 50 var newortdetail = false;
51 51
52 var ortid = fform.findField('ortId').getValue(); 52 var ortidfield = fform.findField('ortId');
53 var ortid = ortidfield.getValue();
53 if (ortid === null) { 54 if (ortid === null) {
54 console.log('New Ortdetail'); 55 console.log('New Ortdetail');
55 ortdetail = Ext.create('Lada.model.Ortdetail'); 56 ortdetail = Ext.create('Lada.model.Ortdetail');
56 ortdetailstore.add(ortdetail); 57 ortdetailstore.add(ortdetail);
57 newortdetail = true; 58 newortdetail = true;
72 if (newortdetail) { 73 if (newortdetail) {
73 // Get ID from new created ortdetail and set it to the ort 74 // Get ID from new created ortdetail and set it to the ort
74 var response = options.operations.create[0].store.proxy.reader.jsonData; 75 var response = options.operations.create[0].store.proxy.reader.jsonData;
75 form.model.set('ortId', response.ortId); 76 form.model.set('ortId', response.ortId);
76 } 77 }
78 ortidfield.setValue(ortid);
77 form.commit(); 79 form.commit();
78 }, 80 },
79 failure: function() { 81 failure: function() {
80 console.log('Error on saving Ortdetails'); 82 console.log('Error on saving Ortdetails');
81 } 83 }

http://lada.wald.intevation.org