kendo-react icon indicating copy to clipboard operation
kendo-react copied to clipboard

Form component improvements

Open simonssspirit opened this issue 5 years ago • 13 comments

  • [x] FieldArray component - useful for Grid like components. This allows optimizations like getting new data only when needed. For example if Grid is used, it can get values on first render and refresh it only on hitting Add New button.
  • [x] Form level validation - submit level validation.
  • [x] Submitted form state
  • [x] Passing additional props to Field validator - demo here
  • [ ] Async validations - validation functions to support promises.
  • [ ] Submit remote validations - workaround till feature is available: in this demo + validation debounce
  • [ ] API additions - component property for the Form and render property for the Field component.
  • [ ] Improve hooks support - need to add alternative to render prop of the form for that case
  • [ ] FieldRenderProps - Add field form to FieldRenderProps that will contain setFieldValue method to allow update dependent fields.
  • [x] onFormReset in the ref - Provide onFormReset in the component ref so it can be used to reset the form was the submit is complete.
  • [ ] Form Item - new component to handle labels binding to editor automatically (taking care of id, htmlFor and editor ref)
  • [ ] FieldArray example - Add an example for the FieldArray or make the current one located in the validation section more visible. Improve the current example with cell validation. Also make FieldArray and Field pass it's field name to the render props to able to build nested fields easily. For example we can than pass it using context. demo
  • [ ] Hooks Form - There is huge search demand for react hook form.

simonssspirit avatar Jan 15 '20 07:01 simonssspirit

FieldArray and Form level validation are available in 3.11.0-dev.202002031337

vladimirivanoviliev avatar Feb 05 '20 07:02 vladimirivanoviliev

In my opinion, KendoReact's Form component should have a method for changing the error status of a field. This would be very useful in case of ajax validations.

Formik has this signature for the onSubmit() method:

onSubmit(values, {setSubmitting, setFieldError})

setFieldError('node_of_json', 'Error message')

This function applies the error classes and puts the message under the field.

Thanks a lot.

robmarzialetti avatar Jan 28 '21 11:01 robmarzialetti

validation on submit requested again in 1519935

simonssspirit avatar May 18 '21 05:05 simonssspirit

server validation requested again in 1522895

simonssspirit avatar Jun 08 '21 05:06 simonssspirit

What should be done for the server validation? In my eyes only a demo is missing.

Xizario avatar Jun 16 '21 14:06 Xizario

For server validations we need to add support for promises. I think the time for this improvement has come.

vladimirivanoviliev avatar Jun 16 '21 17:06 vladimirivanoviliev

server validation requested again in 1536675

simonssspirit avatar Sep 24 '21 05:09 simonssspirit

request for server validation: 1543675

simonssspirit avatar Nov 22 '21 09:11 simonssspirit

server validation + FormContext requested in 1556209

simonssspirit avatar Mar 07 '22 05:03 simonssspirit

We would love to see this finished, especially the async/server validations.

ceby-gannetflemming avatar May 02 '22 18:05 ceby-gannetflemming

Is there a work around for async/server validation ?

samaybhavsar avatar Jun 28 '22 05:06 samaybhavsar

Is there any work on an async validator?

jmarbutt avatar Oct 02 '23 20:10 jmarbutt