APIs

Show:

Base route for the Edit Forms.

This class re-exports to the application as /routes/edit-form. So, you can inherit from ./edit-form, even if file app/routes/edit-form.js is not presented in the application.

Example:

// app/routes/employee.js
import EditFormRoute from './edit-form';
export default EditFormRoute.extend({
});

If you want to add some common logic on all Edit Forms, you can override app/routes/edit-form.js as follows:

// app/routes/edit-form.js
import EditFormRoute from 'ember-flexberry/routes/edit-form';
export default EditFormRoute.extend({
});

Methods

_openReadOnly

(
  • answer
  • resolve
  • reject
  • reason
)
private

Depending on answer, open form read only or transition to parent route.

Parameters:

_rowAdded

(
  • componentName
  • record
)
private

Event handler for "row has been selected" event in FlexberryGroupeditComponent.

Parameters:

_rowChanged

(
  • componentName
)
private

Event handler for "model(s) corresponding to some row(s) was changed" event in FlexberryGroupeditComponent.

Parameters:

_rowDeleted

(
  • componentName
  • record
)
private

Event handler for "row has been deleted" event in FlexberryGroupeditComponent.

Parameters:

actions.groupEditRowClick

(
  • record
  • [options]
)

FlexberryGroupeditComponent row click handler. It sets modelNoRollBack to true at current controller, redirects to detail's route, save necessary data to service.

Parameters:

  • record EmberObject

    Record related to clicked table row.

  • [options] Object optional

    Record related to clicked table row.

    • saveBeforeRouteLeave Boolean

      Flag: indicates whether to save current model before going to the detail's route.

    • editOnSeparateRoute Boolean

      Flag: indicates whether to edit detail on separate route.

    • modelName String

      Clicked detail model name (used to create record if record is undefined).

    • detailArray Array

      Current detail array (used to add record to if record is undefined).

    • editFormRoute Boolean

      Path to detail's form.

actions.willTransition

()

The willTransition action is fired at the beginning of any attempted transition with a Transition object as the sole argument. More info.

actions.willTransition

(
  • transition
)

It sends message about transition to corresponding controller.

The willTransition action is fired at the beginning of any attempted transition with a Transition object as the sole argument. More info.

Parameters:

activate

()

This hook is executed when the router enters the route. It is not executed when the model for the route changes.

It is used to subscribe on FlexberryGroupeditComponent events.

beforeModel

(
  • transition
)
Promise

This hook is the first of the route entry validation hooks called when an attempt is made to transition into a route or one of its children. More info.

Parameters:

  • transition Transition

Returns:

beforeModel

(
  • transition
)
Promise

This hook is the first of the route entry validation hooks called when an attempt is made to transition into a route or one of its children. More info.

Parameters:

  • transition Transition

Returns:

deactivate

()

This hook is executed when the router completely exits this route. It is not executed when the model for the route changes.

It is used to unsubscribe from FlexberryGroupeditComponent events.

model

(
  • params
  • transition
)

A hook you can implement to convert the URL into the model for this route. More info.

Parameters:

newRoutePath

(
  • ordinalPath
)
String

It forms path for new model's route.

Parameters:

  • ordinalPath String

    The path to model's route.

Returns:

String:

The path to new model's route.

openReadOnly

(
  • lockUserName
)
Promise

This function will be called to solve open form read only or transition to parent route. You can override function for custom behavior.

Parameters:

Returns:

Example:

// app/routes/user-edit.js
                    
                    import EditFormRoute from 'ember-flexberry/routes/edit-form';
                    
                    export default EditFormRoute.extend({
                      ...
                      openReadOnly(lockUserName) {
                        return new RSVP.Promise((resolve) => {
                          let answer = confirm(This object lock user with name: '${lockUserName}'. Open read only?);
                          resolve(answer);
                        });
                      },
                      ...
                    });
                    

resetController

(
  • controller
  • isExisting
  • transition
)

A hook you can use to reset controller values either when the model changes or the route is exiting. More info.

Parameters:

setupController

(
  • controller
  • model
)

A hook you can use to setup the controller for the current route. More info.

Parameters:

  • controller Controller
  • model Object

setupController

(
  • controller
  • model
)

A hook you can use to setup the controller for the current route. More info.

Parameters:

  • controller Controller
  • model Object

unlockObject

() Promise

This function will be called to solve unlock the object before form close. You can override function for custom behavior.

Returns:

Example:

// app/routes/user-edit.js
                    
                    import EditFormRoute from 'ember-flexberry/routes/edit-form';
                    
                    export default EditFormRoute.extend({
                      ...
                      unlockObject() {
                        return new RSVP.Promise((resolve) => {
                          let answer = confirm(Unlock this object?);
                          resolve(answer);
                        });
                      },
                      ...
                    });
                    

Properties

_groupEditEventsService

Service private

Service that triggers FlexberryGroupeditComponent events.

Default: ObjectlistviewEventsService

appState

AppStateService

Service for managing the state of the application.

colsConfigMenu

Service

defaultBehaviorLock

Object

This object contains answers which will corresponding functions resolved.

Default: { openReadOnly: true, unlockObject: true }

flexberryDetailInteractionService

Service

Service that lets interact between agregator's and detail's form.

Default: DetailInteractionService

modelName

String
Model name.

modelProjection

Projection
Model projection.

newSuffix

String

Suffix for new route (has value only on new routes).

parentRoute

String

Route name corresponding edit form.

parentRouteRecordId

String

Route id corresponding edit form.

queryParams

Object

Configuration hash for this route's queryParams. More info.