You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you call setFieldsValue, there is a warning because the dynamic rendering field is not registered in the FieldsStore of rc-form: Warning: You cannot set a form field before rendering a field associated with the value.
You have to call setFieldsValue or setFieldsValue again to set the value of the dynamically rendered FormItem.
如果调用setFieldsValue,由于动态渲染field没有注册到rc-form的FieldsStore中,所以会有一个警告:Warning: You cannot set a form field before rendering a field associated with the value.
必须再次调用setFieldsValue或setFieldsValue才能设置动态渲染出来的FormItem的值。
What does the proposed API look like?
Can you support adding a props to FormItem: condition (may not call this name)
API example
Register all dynamic FormItem in FieldsStore.
Notice that there is a hidden option in getFieldProps of rc-form
Is it possible to hide the item via css and set hidden option?
What problem does this feature solve?
Sample: https://codesandbox.io/s/antd-reproduction-template-eky0k
Click Change form data -> Click rerun setFieldsValue
Now, when we use dynamic rendering for FormItem like this:
If you call setFieldsValue, there is a warning because the dynamic rendering field is not registered in the FieldsStore of rc-form: Warning: You cannot set a form field before rendering a field associated with the value.
You have to call setFieldsValue or setFieldsValue again to set the value of the dynamically rendered FormItem.
现在在动态渲染FormItem的时候,例如
如果调用setFieldsValue,由于动态渲染field没有注册到rc-form的FieldsStore中,所以会有一个警告:Warning: You cannot set a form field before rendering a field associated with the value.
必须再次调用setFieldsValue或setFieldsValue才能设置动态渲染出来的FormItem的值。
What does the proposed API look like?
Can you support adding a props to FormItem: condition (may not call this name)
API example
Register all dynamic FormItem in FieldsStore.
Notice that there is a hidden option in getFieldProps of rc-form
Is it possible to hide the item via css and set hidden option?
能否支持在FormItem 中添加一个props: condition(可能不叫这个名字)
API例如
将所有动态的表单项都注册。
注意到rc-form的getFieldProps options参数中有hidden这一个选项。
是否能通过css和 rc-form getFieldProps options中的 hidden来隐藏和忽略该项?
The text was updated successfully, but these errors were encountered: