# new UForm (cfgobject)

Arguments:
  • cfg: object
    • componentVue.Component

      Form component

    • rootComponentVue.Component

      Alias for cfg.component

    • propsobject

      Form component props

    • titlestring

      Form title

    • entitystring

      Entity name for master record

    • instanceIDnumber

      Instance ID

    • isModalboolean

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

    • openInBackgroundTabboolean

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

    • modalClassstring

      Modal class

    • modalWidthstring

      Modal width

    • formCodestring

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

    • tabIdstring

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

    • uiTagstring

      Optional UI Tag for tracking subsystem

    • targetobject

      Optional target. Used for render form into form

    • isCopyboolean

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

    • titleTooltipstring

      Form title tooltip

    • onClosefunction

      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

Methods

# processing (cfgoptObject, saveNotificationoptfunction, errorNotificationoptfunction, transformSaveRequestoptfunction) → 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
  • 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 (storeConfigoptwindow.Vuex.StoreOptions) → UForm instance

Arguments:
  • storeConfig = {}: window.Vuex.StoreOptions

    Vuex store constructor options - merged with UForm store

# validation (validationOptionsoptVue.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