-
Notifications
You must be signed in to change notification settings - Fork 33
-
Hi,
I created two forms from formbuilder. The button in Form A will open a modal to display Form B.
There are two forms of data in IndexDB. How can I use formViewer to display the overall effect? The button in A opens a modal window to show B. I tried it, but it can only display the data of one of the forms. Clicking the button in A will open the modal, but the content still displays the data from form A.
I would appreciate it if you could show me the entire case.
imageBeta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 2 replies
-
The form of the modal window is loaded via the getForm function (https://formengine.io/documentation/api-reference/@react-form-builder/core/interfaces/FormViewerProps#getform), to which the name of the form of the modal window is passed. You need to make the getForm function return different strings depending on the function parameters.
Beta Was this translation helpful? Give feedback.
All reactions
-
I have prepared the following data to pass to FormViewer
const form = { "form": { "key": "Screen", "type": "Screen", "props": { "disabled": { "value": false } }, "css": { "any": { "object": { "flexDirection": "column" } } }, "children": [ { "key": "rsButton1", "type": "RsButton", "props": {}, "events": { "onClick": [ { "name": "openModal", "type": "common", "args": { "modalKey": "modal1" } } ] } }, { "key": "modal1", "type": "Modal", "props": { "modalTemplate": { "value": "Template:2" } }, "modal": { "props": {}, "events": {} } }, { "key": "rsSearch1", "type": "RsSearch", "props": { "label": { "value": "" } }, "events": { "onSearch": [ { "name": "search", "type": "code" } ] } } ] } }
From the data, it can be seen that a button will open the Modal.
My question is, how should I transfer the data presented by the Modal?
Currently, the Modal only indicates the name of the modalTemplate.
Could you provide me with some demo data?
Beta Was this translation helpful? Give feedback.
All reactions
-
@Caesar-ch Sure. Take a look into this part of the documentation https://formengine.io/documentation/modal-components.
Beta Was this translation helpful? Give feedback.