# new UForm (cfg:  object)

Arguments:
  • cfg: object
    • component:  Vue.Component

      Form component

    • rootComponent:  Vue.Component

      Alias for cfg.component

    • props:  object

      Form component props

    • title:  string

      Form title

    • entity:  string

      Entity name for master record

    • instanceID:  number

      Instance ID

    • isModal:  boolean

      If true form will be displayed inside modal dialog. Otherwise - in tab (default)

    • openInBackgroundTab:  boolean

      If true - the tab with a newly opened form does not become active

    • modalClass:  string

      Modal class

    • modalWidth:  string

      Modal width

    • formCode:  string

      Required to provide form code for form constructor button in toolbar and for correct tabID generation

    • tabId:  string

      Optional tabId. If omitted will be calculated using entity code and instanceID

    • uiTag:  string

      Optional UI Tag for tracking subsystem

    • target:  object

      Optional target. Used for render form into form

    • isCopy:  boolean

      Required isCopy. Used for create new record with data of existing record

    • titleTooltip:  string

      Form title tooltip

    • beforeClose:  function

      Callback, 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:  function

      Async 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

    • modalType

    • iconCls

    • commandConfig

    • modalId

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: object
    • masterFieldList:  Array.<string>

      form field list. By default all entity attributes

    • collections:  object

    • beforeInit:  function

    • inited:  function

    • beforeSave:  function

      Called before form creates insert\update request. If returned value is resolved to false then save action is canceled

    • afterValidated:  function

      Called after form is validated but before data is passed to server

    • saved:  function

    • beforeCreate:  function

    • created:  function

    • beforeLoad:  function

    • loaded:  function

    • beforeDelete:  function

    • deleted:  function

    • beforeCopy:  function

    • copied:  function

    • saveNotification

    • errorNotification

    • transformSaveRequest

  • saveNotification: function

    Callback that overrides the default save notification

  • errorNotification: function

    Callback that overrides the default error notification

  • transformSaveRequest: function

    Function that can manipulate requests before sending to server: order, patch, etc.

# store (storeConfigopt:  Vuex.StoreOptions) → UForm instance

Arguments:
  • storeConfig = {}: Vuex.StoreOptions

    Vuex 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.ComponentOptions

    Custom validation mixin in case we need to override default validation