Settup up the custom field so they get updated.
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 18 Dec 2017 15:51:31 +0000 (10:51 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 18 Dec 2017 15:51:31 +0000 (10:51 -0500)
When updating the registrant or attendee it will save the custom fields.

js/frontRegApp.js
js/views/front/regRequestRegistrant.js
js/views/front/regTime.js

index af33b67..02e6429 100644 (file)
@@ -819,6 +819,11 @@ app.Views.Front.RegRequestRegistrant = Backbone.View.extend({
 
     // update the model
     update: function(){
+        // Need to grab all of the custom field data and serialize it here first.
+        // For some reason this is not available after the newRegistrant is added
+        // to the collection.
+        var customFieldData = this.$( 'form.attendee-cf-form-' + this.model.get('id') ).serialize();
+
         var modelId = this.model.get( 'id' );
         var fname   = this.$('.reg_fname').val().trim();
         var lname   = this.$('.reg_lname').val().trim();
@@ -855,7 +860,8 @@ app.Views.Front.RegRequestRegistrant = Backbone.View.extend({
             state: state,
             zip: zip,
             country: country,
-            reg_time: rTime
+            reg_time: rTime,
+            customFields: customFieldData,
         });
         this.model.save();
         if ( this.model.validationError ) {
@@ -1012,6 +1018,9 @@ app.Views.Front.RegTime = Backbone.View.extend({
             return;
         }
 
+        // Need to grab all of the custom field data and serialize it here first.
+        // For some reason this is not available after the newRegistrant is added
+        // to the collection.
         var customFieldData = this.$( 'form.attendee-cf-form-new' ).serialize();
 
         // return false;
index 783e4fe..fc3b185 100644 (file)
@@ -21,6 +21,11 @@ app.Views.Front.RegRequestRegistrant = Backbone.View.extend({
 
     // update the model
     update: function(){
+        // Need to grab all of the custom field data and serialize it here first.
+        // For some reason this is not available after the newRegistrant is added
+        // to the collection.
+        var customFieldData = this.$( 'form.attendee-cf-form-' + this.model.get('id') ).serialize();
+
         var modelId = this.model.get( 'id' );
         var fname   = this.$('.reg_fname').val().trim();
         var lname   = this.$('.reg_lname').val().trim();
@@ -57,7 +62,8 @@ app.Views.Front.RegRequestRegistrant = Backbone.View.extend({
             state: state,
             zip: zip,
             country: country,
-            reg_time: rTime
+            reg_time: rTime,
+            customFields: customFieldData,
         });
         this.model.save();
         if ( this.model.validationError ) {
index 084449e..9af23a5 100644 (file)
@@ -101,6 +101,9 @@ app.Views.Front.RegTime = Backbone.View.extend({
             return;
         }
 
+        // Need to grab all of the custom field data and serialize it here first.
+        // For some reason this is not available after the newRegistrant is added
+        // to the collection.
         var customFieldData = this.$( 'form.attendee-cf-form-new' ).serialize();
 
         // return false;