formio / formio.js

JavaScript powered Forms with JSON Form Builder

Home Page:https://formio.github.io/formio.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] Builder:Can i load my custom forms for nested form

ababeel-ceo opened this issue · comments

Can i load my own forms for nested form in builder

image

Yes this can be done. This is the "editForm" for the Nested Form component. You can view it by typing the following in your console when viewing the builder.

Formio.Components.components.form.editForm()

This is a function that can be overridden like so where you can replace the default select dropdown with your own... Maybe something like this would work?

const editForm = Formio.Components.components.form.editForm;
Formio.Components.components.form.editForm = function(...args) {
  const currentForm = editForm(...args);
  const select = Formio.Utils.getComponent(currentForm.components, 'form');
  select.data.url = '.... YOUR OWN CUSTOM ENDPOINT ....';
  return currentForm;
}