# new UForm (cfg: object)
Arguments:
cfg: objectcomponent: Vue.ComponentForm component
rootComponent: Vue.ComponentAlias for cfg.component
props: objectForm component props
title: stringForm title
entity: stringEntity name for master record
instanceID: numberInstance ID
isModal: booleanIf true form will be displayed inside modal dialog. Otherwise - in tab (default)
openInBackgroundTab: booleanIf
true- the tab with a newly opened form does not become activemodalClass: stringModal class
modalWidth: stringModal width
formCode: stringRequired to provide form code for form constructor button in toolbar and for correct tabID generation
tabId: stringOptional tabId. If omitted will be calculated using entity code and instanceID
uiTag: stringOptional UI Tag for tracking subsystem
target: objectOptional target. Used for render form into form
isCopy: booleanRequired isCopy. Used for create new record with data of existing record
titleTooltip: stringForm title tooltip
beforeClose: functionCallback, called before form is closed (not forcefully). This implementation will replace the standard one, which asks the user to save or discard changes or continue to edit
onClose: functionAsync callback, called (and awaited) before form is destroyed with 2 args: (ID: number|null, store: Vuex.Store); In case form is in isNew state, ID value is null, otherwise - an ID from store
modalTypeiconClscommandConfigmodalId
Methods
# processing (cfgopt: object, saveNotificationopt: function, errorNotificationopt: function, transformSaveRequestopt: function) → UForm instance
Sets store field list, collections and lifecycle hooks. All hooks are called with one argument $store and this === current form.
Arguments:
cfg: objectmasterFieldList: Array.<string>form field list. By default all entity attributes
collections: objectbeforeInit: functioninited: functionbeforeSave: functionCalled before form creates insert\update request. If returned value is resolved to
falsethen save action is canceledafterValidated: functionCalled after form is validated but before data is passed to server
saved: functionbeforeCreate: functioncreated: functionbeforeLoad: functionloaded: functionbeforeDelete: functiondeleted: functionbeforeCopy: functioncopied: functionsaveNotificationerrorNotificationtransformSaveRequest
saveNotification: functionCallback that overrides the default save notification
errorNotification: functionCallback that overrides the default error notification
transformSaveRequest: functionFunction that can manipulate requests before sending to server: order, patch, etc.
# store (storeConfigopt: Vuex.StoreOptions) → UForm instance
Arguments:
storeConfig= {}: Vuex.StoreOptionsVuex store constructor options - merged with UForm store
# validation (validationOptionsopt: Vue.ComponentOptions) → UForm instance
Custom validator function. In case validation not called or called without argument then validator function
is generated automatically based on entitySchema
Arguments:
validationOptions: Vue.ComponentOptionsCustom validation mixin in case we need to override default validation
