Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closeallfeildedit not working #1455

Closed
vinokumark opened this issue Oct 18, 2023 · 9 comments
Closed

Closeallfeildedit not working #1455

vinokumark opened this issue Oct 18, 2023 · 9 comments

Comments

@vinokumark
Copy link

jQuery.Deferred exception: formBuilder.actions.closeAllFieldEdit is not a function TypeError: formBuilder.actions.closeAllFieldEdit is not a function

How to disable the all field while render the data

@lucasnetau
Copy link
Collaborator

Please provide a full reproduction script for your issue. I cannot replicate your issue locally, closeAllFieldEdit is defined. It would suggest that your formBuilder instance has not been initialised correctly

@lucasnetau lucasnetau added the needs-reproduction Issue needs full code example to reproduce label Oct 18, 2023
@vinokumark
Copy link
Author

vinokumark commented Oct 19, 2023 via email

@lucasnetau
Copy link
Collaborator

@vinokumark
Copy link
Author

vinokumark commented Oct 19, 2023 via email

@lucasnetau
Copy link
Collaborator

formBuilder.actions.closeAllFieldEdit() is a single action call which will closes all edit fields on the stage. The documentation link provided includes all javascript required in the example.

@vinokumark
Copy link
Author

vinokumark commented Oct 19, 2023 via email

@lucasnetau
Copy link
Collaborator

This is wrong in the codepen

$(fbEditor).formBuilder.actions.closeAllFieldEdit()

should be

formBuilder.actions.closeAllFieldEdit()

However the issue is what I mentioned in my first response. formBuilder isn't initialised at the time you call closeAllFieldEdit. I'm unsure why you are wanting to call it straight away since you don't have any edit panels open after loading the form, however if you do want to call it you need to wait for formBuilder to initialise first. The simplest way to do that is to use the promise function

https://formbuilder.online/docs/formBuilder/promise/

Normally you would be calling closeAllFieldEdit() from some piece of code in reaction to say clicking a button.

@lucasnetau
Copy link
Collaborator

While not solving you issue, PR ##1459 landed which will emit an error if you try to call a function prior to formBuilder being initialised

@lucasnetau lucasnetau removed the needs-reproduction Issue needs full code example to reproduce label Oct 24, 2023
@lucasnetau
Copy link
Collaborator

Feedback provided and additional error reporting make to formBuilder to highlight trying to execute actions before initialisation is complete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants