App.form

App.form

Responsible of rendering a Form in either VIEW, EDIT or CREATE mode. To create a Form use one of the factory functions described below.

Input The following input can be passed when creating a new form instance.

var input = {
  options: {
    buttonClasses: {       // CSS classes that can be added to the form buttons
      general: 'fa',       // CSS classes that are applied to all buttons
      edit: 'fa-eye',      // CSS classes that are applied to edit button
      display: 'fa-pencil' // CSS classes that are applied to display button
      save: 'fa-save'      // CSS classes that are applied to save button
    },
    formMode: 'VIEW',      // What view should the form be rendered in. Valid values 'VIEW', 'EDIT',
                           // 'CREATE', 'CREATE_AND_CONNECT' and 'CREATE_WITH_CONNECTIONS'
    updateServiceMethodMapping: {
      CREATE: {
        onSuccess: App.custom.myCreateSuccessHandler // callback executed on successful create
      },
      EDIT: {
        onSuccess: App.custom.myEditSuccessHandler // callback executed on successful edit
      }
    }
  }
};

Classes

Form

Methods

(static) createAndConnect(input) → {App.form.Form}

Factory function that creates a new Form in CREATE_AND_CONNECT mode.

Parameters:
Name Type Description
input Object

to be used when creating the form. See above

Returns:

The created Form instance

Type
App.form.Form

(static) createNew(input) → {App.form.Form}

Factory function that creates a new Form instance in CREATE mode.

Parameters:
Name Type Description
input Object

to be used when creating the form. See above

Returns:

The created Form instance

Type
App.form.Form

(static) createWithConnections(input) → {App.form.Form}

Factory function that creates a new Form instance in CREATE_WITH_CONNECTIONS mode.

Parameters:
Name Type Description
input Object

to be used when creating the form. See above

Returns:

The created Form instance

Type
App.form.Form

(static) edit(input) → {App.form.Form}

Factory function that creates a new Form instance in EDIT mode.

Parameters:
Name Type Description
input Object

to be used when creating the form. See above

Returns:

The created Form instance

Type
App.form.Form

create(input) → {App.form.Form}

Factory function that creates a new Form instance.

Parameters:
Name Type Description
input Object

to be used when creating the form. See above

Returns:

The created Form instance

Type
App.form.Form