New to Kendo UI for Vue? Start a free 30-day trial

Represents the props that are passed from the Form component to the components nested inside it. To use the KendoFrom Injected Property it should be injected it in the component that defines the Form content using the below code.

js
  ...........
  inject: {
      kendoForm: { default: {} },
  }
  ...........

Definition

Package:@progress/kendo-vue-form

Properties

Indicates if the Form is ready to be submitted. If allowSubmit is set to true and the Form is valid, the user will be able to submit the form. If allowSubmit is set to true and the Form is not valid, the user will be able to set all fields touched and visited state to true. Useful for toggling the disabled state of the Submit button.

errors?

object

The key-value pair containing the current errors by field path, combined from both field and form level validators.

modified

boolean

Indicates if the Form is modified. If any field is modified, modified is set to true. The modified state of field is set to true when the onChange callback of the Field component is called for first time.

An object that holds the modified fields.

onBlur

(fieldName: string) => void

A callback to call when the rendered component for the specified field is blurred. Responsible for setting the touched state of the Field.

Parameters:fieldNamestring

onChange

(fieldName: string, event: { target?: any; value?: any }) => void

A callback you have to call when the value of the rendered component is changed (see example). The value property of the event takes precedence over target.value.

Parameters:fieldNamestringevent{ target?: any; value?: any }

onFocus

(fieldName: string) => void

A callback to call when the rendered component for the specified field is focused. Responsible for setting the visited state of the Field.

Parameters:fieldNamestring

onFormReset

() => void

A callback for resetting the Form.

onInsert

(fieldName: string, options: { index: number; value: any }) => void

A callback to insert a value at the given index of the specified field array.

Parameters:fieldNamestringoptions{ index: number; value: any }

onMove

(fieldName: string, options: { nextIndex: number; prevIndex: number }) => void

A callback to move a value in the specified field array. Useful for drag and drop reordering.

Parameters:fieldNamestringoptions{ nextIndex: number; prevIndex: number }

A callback to remove a value from the end of the specified field array. The value is returned.

Parameters:fieldNamestringReturns:

any

onPush

(fieldName: string, options: { value: any }) => void

A callback to add a value to the end of the specified field array.

Parameters:fieldNamestringoptions{ value: any }

A callback to remove a value from the given index of the specified field array.

Parameters:fieldNamestringoptions{ index: number }Returns:

any

onReplace

(fieldName: string, options: { index: number; value: any }) => void

A callback to replace a value at the given index of the specified field array.

Parameters:fieldNamestringoptions{ index: number; value: any }

onSubmit

(event: any) => void

A callback for submitting the Form. Can be passed to the onClick property of the Submit button.

Parameters:eventany

onUnshift

(fieldName: string, options: { value: any }) => void

A callback to add a value to the beginning of the specified field array.

Parameters:fieldNamestringoptions{ value: any }

submitted

boolean

Indicates if the Form is successfully submitted. Useful for detecting if user is leaving the form before saving changes.

touched

boolean

Indicates if the Form is touched. If any field is touched, touched is set to true. The touched state of field is set to true when the onBlur callback of the Field component is called or when the user tries to submit the form.

An object that holds the touched fields.

valid

boolean

Indicates if the Form is valid. If any field is invalid, valid is set to false.

validate

(options: { [key: string]: any }) => void

When called without parameters it validates all the fields in the Form. If called with object parameter with keys names - the names of the fields, only these fields are validated.

Parameters:options?{ [key: string]: any }

A callback for getting the value of a field without using the Field component (see example). Useful for creating and modifying the UI based on the field values.

Parameters:namestringReturns:

any

visited

boolean

Indicates if the Form is visited. If any field is visited, visited is set to true. The visited state of field is set to true when the onFocus callback of the Field component is called or when the user tries to submit the form.

An object that holds the visited fields.