resolve recordpicker for single record if modelconfig type equals record
authorMichael Spahn <m.spahn@metaways.de>
Wed, 5 Jul 2017 15:10:39 +0000 (17:10 +0200)
committerMichael Spahn <m.spahn@metaways.de>
Wed, 5 Jul 2017 15:14:56 +0000 (17:14 +0200)
Change-Id: Ifeefbf114e0c436fb14c6f24699ade1675951a5e
Reviewed-on: http://gerrit.tine20.com/customers/5024
Reviewed-by: Michael Spahn <m.spahn@metaways.de>
Tested-by: Michael Spahn <m.spahn@metaways.de>
tine20/Tinebase/js/widgets/form/FieldManager.js

index 9506b2c..ae4da8e 100644 (file)
@@ -131,6 +131,12 @@ Tine.widgets.form.FieldManager = function() {
                     field.xtype = 'addressbookcontactpicker';
                     field.userOnly = true;
                     break;
+                case 'record':
+                    if (fieldDefinition.config && fieldDefinition.config.appName && fieldDefinition.config.modelName) {
+                        var picker = Tine.widgets.form.RecordPickerManager.get(fieldDefinition.config.appName, fieldDefinition.config.modelName, Ext.apply(field, config));
+                        field = picker;
+                    }
+                    break;
                 case 'keyfield':
                     field.xtype = 'widget-keyfieldcombo';
                     field.app = app;
@@ -145,7 +151,7 @@ Tine.widgets.form.FieldManager = function() {
                     break;
             }
 
-            Ext.applyIf(field, config);
+            Ext.apply(field, config);
 
             return field;
         },