| | |
| | | **********************************************/ |
| | | class PopulateForm { |
| | | constructor(form, fieldData = {}, imageData = {}, options = {}) { |
| | | console.log('Populating field... ', form); |
| | | console.log('fieldData: ', fieldData); |
| | | console.log('imageData: ', imageData); |
| | | console.log('options: ', options); |
| | | for (let [fieldName, fieldValue] of Object.entries(fieldData)) { |
| | | let wrapper = form.querySelector(`[data-field="${fieldName}"]`); |
| | | if (wrapper) { |
| | |
| | | * Populate repeater fields |
| | | */ |
| | | populateRepeaterField(fieldWrapper, fieldName, fieldValue, options = {}) { |
| | | console.log('fieldWrapper', fieldWrapper); |
| | | console.log('fieldName', fieldName); |
| | | console.log('fieldValue', fieldValue); |
| | | console.log('options', options); |
| | | if (!fieldValue || !Array.isArray(fieldValue)) { |
| | | return; |
| | | } |