-
Notifications
You must be signed in to change notification settings - Fork 1
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
How to init state of component when init form? #11
Comments
can init state of component in stateChange function.
|
above code can also fix AsyncMultiSelect display 'no options' #47
|
@WangLarry True :)
Upside - you init all your form configuration just one time in a single point - which is easy to track and change.
Upside - better UX experience (the user immediately see the ui of the form when the page is loaded).
Upside - better UX experience (the user immediately see the ui of the form when the page is loaded). Also all the component "logic" and configuration remains in the component scope. Note: Choose the best practice for your app :) |
|
@WangLarry |
I think that performance is considered lately.
|
Is your feature request related to a problem? Please describe.
For some components, for example multiselect, it is normal that select's options come from backend server. How to init state(options or items) of these components when init form?
I notice that react-editor custom codes do it when init model data.
Describe the solution you'd like
Can configure component in model, set initComponentState function, then async call it in beforeInitForm.
The text was updated successfully, but these errors were encountered: