EditFormNewRoute Class
Base route for the Create Forms.
Example:
// app/routes/employee/new.js
import EditFormNewRoute from 'ember-flexberry/routes/edit-form-new';
export default EditFormNewRoute.extend({
});
Item Index
Methods
Methods
_openReadOnly
-
answer
-
resolve
-
reject
-
reason
Depending on answer, open form read only or transition to parent route.
_rowAdded
-
componentName
-
record
Event handler for "row has been selected" event in FlexberryGroupeditComponent.
Parameters:
-
componentName
StringThe name of FlexberryGroupeditComponent.
-
record
DS.ModelThe model corresponding to added row in FlexberryGroupeditComponent.
_rowChanged
-
componentName
Event handler for "model(s) corresponding to some row(s) was changed" event in FlexberryGroupeditComponent.
Parameters:
-
componentName
StringThe name of FlexberryGroupeditComponent.
_rowDeleted
-
componentName
-
record
Event handler for "row has been deleted" event in FlexberryGroupeditComponent.
Parameters:
-
componentName
StringThe name of FlexberryGroupeditComponent.
-
record
DS.ModelThe model corresponding to deleted row in FlexberryGroupeditComponent.
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
EmberObjectRecord related to clicked table row.
-
[options]
Object optionalRecord related to clicked table row.
-
saveBeforeRouteLeave
BooleanFlag: indicates whether to save current model before going to the detail's route.
-
editOnSeparateRoute
BooleanFlag: indicates whether to edit detail on separate route.
-
modelName
StringClicked detail model name (used to create record if record is undefined).
-
detailArray
ArrayCurrent detail array (used to add record to if record is undefined).
-
editFormRoute
BooleanPath 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.
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
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.
newRoutePath
-
ordinalPath
It forms path for new model's route.
Parameters:
-
ordinalPath
StringThe path to model's route.
Returns:
The path to new model's route.
openReadOnly
-
lockUserName
This function will be called to solve open form read only or transition to parent route. You can override function for custom behavior.
Parameters:
-
lockUserName
String
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);
});
},
...
});
renderTemplate
-
controller
-
model
A hook you can use to render the template for the current route. More info.
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.
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
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
modelProjection
Projection
prototypeProjection
String
The projection name to be used when creating record
by prototype (has value only on new routes).
Overrides the value of prototypeProjection
model property.