diff app/view/orte/CreateForm.js @ 497:7c0653e8d9f7

Fixed some js related issues (unused vars, arrays, etc.) and code style.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 06 Nov 2014 10:38:17 +0100
parents d07e5086a64b
children 8b4ec61c5752
line wrap: on
line diff
--- a/app/view/orte/CreateForm.js	Thu Nov 06 10:35:35 2014 +0100
+++ b/app/view/orte/CreateForm.js	Thu Nov 06 10:38:17 2014 +0100
@@ -3,7 +3,7 @@
  *
  * This file is Free Software under the GNU GPL (v>=3)
  * and comes with ABSOLUTELY NO WARRANTY! Check out
- * the documentation coming with IMIS-Labordaten-Application for details. 
+ * the documentation coming with IMIS-Labordaten-Application for details.
  */
 
 /*
@@ -11,14 +11,16 @@
  */
 Ext.define('Lada.view.orte.CreateForm', {
     extend: 'Lada.view.widgets.LadaForm',
-    model: 'Lada.model.Ort',
     requires: [
         'Lada.view.widgets.Ortdetail',
         'Lada.view.widgets.Staat',
         'Lada.view.widgets.Verwaltungseinheit',
         'Lada.view.orte.CreateOrt'
     ],
+
+    model: 'Lada.model.Ort',
     edit: false,
+
     initComponent: function() {
         this.items = [{
             xtype: 'ortdetail',
@@ -26,7 +28,7 @@
             fieldLabel: 'Ort',
             listeners: {
                 scope: this,
-                'change': function (field, newv, oldv, opts) {
+                'change': function(field, newv) {
                     if (field.up('window')) {
                         field.up('window').down('fieldset').show();
                     }
@@ -54,10 +56,12 @@
                         });
                     }
 
+                    console.log('found verw');
                     var form = this.getForm();
-                    if ( ort != undefined ) {
-                        for (var i = fields.length - 1; i >= 0; i--){
-                            ffield = form.findField("ort_"+fields[i]);
+                    var ffield = null;
+                    if (ort) {
+                        for (var i = fields.length - 1; i >= 0; i--) {
+                            ffield = form.findField('ort_' + fields[i]);
                             ffield.setValue(ort.get(fields[i]));
                         }
                     }

http://lada.wald.intevation.org