# 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
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
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
false
then save action is canceledsaved
: functionbeforeCreate
: functioncreated
: functionbeforeLoad
: functionloaded
: functionbeforeDelete
: functiondeleted
: functionbeforeCopy
: functioncopied
: function
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: window.Vuex.StoreOptions) → UForm instance
Arguments:
storeConfig
= {}: window.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