Skip to main content

Introducing Formengine - The New Formbuilder, try for FREE formengine.io.

DWKitForm

DWKitForm is component which displays forms created in DWKitFormBuilder.

import {DWKitForm, initDefaultState, initDefaultStateFormUrl, validate, checkConditions} from "./scripts/optimajet-form.js";

<DWKitForm
formName={formName}
data={data}
model={model}
errors={errors}
dataChanged={(form, {key, value}) => {
...
}}
eventFunc={(args) => {
...
}}
getAdditionalDataForControl={this.props.additionalFetch.bind(this, () => {
...
})}
hideControls={hideControls}
readOnlyControls={readOnlyControls}
readOnly={readOnly}
uploadUrl={dataupload}
downloadUrl={datadownload}
autoCheckConditions={true}
autoValidate={true}
/>

Parameters:

#NameTypeComment
1modelJSON or ObjectForm description
2dataJSON or ObjectForm data
3modelurlstringForm request URL
4dataurlstringData request URL
5errorsObjectObject containing form errors
6hideControlsArrayList of control names which must be hidden
7readOnlyControlsArrayList of control names which are read only
8readOnlyboolThe flag defines the form is available for editing
9dataChangedfunction(form, {key, value}) { ... }Handling data changes in forms.
10eventFuncfunction (obj, p) { ... }Handling form events.
11eventErrFuncfunction(obj, message) { ... }Handling form errors.
12getFormFuncfunction(name) { ... }Callback function for getting source form by name
13getAdditionalDataForControlfunction(control, {startIndex, pageSize, filters, sort, model}, callback) { ... }Additional data request. Used in pager controls, such as Dictionary and GridView.
14downloadUrlstringThe url for downloading files. Use for controls which operate files
15uploadUrlstringThe url for uploading files. Use for controls which operate files.
16autoCheckConditionsbooleanEnable internal checking conditions inside a form (ReadOnly, Visible conditions).
17autoValidatebooleanEnable internal validation.