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

Implemented setModel() #420

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lennardschutter
Copy link

Allow for a function setModel(data, [validate]) as a better way to set the initial data for a Formsy. The function has got 2 parameters, data and validate (optional).

Data is used to set the initial model for the form.
Validate is used to determine wether the form should run validation when the data is set.

@aesopwolf
Copy link
Collaborator

What's the use case here? Maybe we should just extend reset instead of introducing a new method?

@lennardschutter
Copy link
Author

We could extend the reset function too, so it can run w/o running the validation. I thought it would make more sense having a seperate method to set the data since we are not always resetting (e.g. data loaded remotely).

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

Successfully merging this pull request may close these issues.

2 participants