DetailEditFormController Class
addon/controllers/detail-edit-form.js:9
Controller for the Detail's Edit Forms. It lets to interact between agregator's and details's forms.
This class re-exports to the application as /controllers/detail-edit-form
.
So, you can inherit from ./detail-edit-form
, even if file app/controllers/detail-edit-form.js
is not presented in the application.
Example:
// app/controllers/order.js
import DetailEditFormController from './detail-edit-form';
export default DetailEditFormController.extend({
});
Item Index
Methods
- _destroyHasManyRelationships
- _getModelWithHasMany
- _openModalDialog
- _reloadModalData
- _saveHasManyRelationships
- actions.addColumnToSorting
- actions.addErrorMessage
- actions.close
- actions.delete
- actions.dismissErrorMessages
- actions.error
- actions.flexberryFileViewImageAction
- actions.groupEditRowClick
- actions.previewLookupValue
- actions.removeLookupValue
- actions.routeWillTransition
- actions.save
- actions.saveAndClose
- actions.showLookupDialog
- actions.sortByColumn
- actions.updateLookupValue
- close
- closeModalDialog
- closeModalDialog
- createdModalDialog
- createdModalDialog
- delete
- getCellComponent
- onDeleteActionFulfilled.
- onDeleteActionRejected.
- onDeleteActionStarted.
- onSaveActionAlways.
- onSaveActionFulfilled.
- onSaveActionRejected.
- onSaveActionStarted.
- openCreateModalDialog
- openEditModalDialog
- rejectError
- rollbackAll
- rollbackHasManyRelationships deprecated
- save
- saveModel
- transitionToParentRoute
- validate
Properties
- _EmberCpValidationsResultCollectionClass
- _hasParentRoute
- _modalControllerName
- _modalTemplateName
- _openedModalDialog
- _openedModalDialog
- appState
- contentTemplate
- context
- controllerName
- defaultDeveloperUserSettings
- destroyHasManyRelationshipsOnModelDestroy
- detachable
- developerUserSettings
- flexberryDetailInteractionService
- flexberryFileModalController
- flexberryFileModalTemplateName
- loaderTemplate
- lookupController
- lookupEventsService
- lookupModalWindowPerPage
- lookupSettings
- modalDialogSettings
- modelCurrentAgregatorPathes
- modelCurrentAgregators
- modelNoRollBack
- objectlistviewEvents
- parentRoute
- parentRouteRecordId
- queryParams
- readonly
- readonlyAttr
- returnToAgregatorRoute
- routeName
- saveBeforeRouteLeave
- template
- validationModel
- validationObject
Methods
_destroyHasManyRelationships
-
model
model
recursively.
This method invokes by delete
method.
Parameters:
-
model
DS.ModelRecord with hasMany relationships.
Returns:
_getModelWithHasMany
-
model
hasMany
relationships, obtained recursively, for each model.
Parameters:
-
model
DS.ModelThe object model.
Returns:
hasMany
relationships.
_openModalDialog
-
modelObject
-
editFormRoute
-
isNewRecord
-
useSidePageMode
_reloadModalData
-
currentContext
-
options
Parameters:
-
currentContext
StringCurrent execution context of this method. -
options
ObjectParameters to load proper data and to tune modal lookup window outlook.-
[relatedToType]
String optionalType of records to load.
-
[projectionName]
String optionalProjection name to load data by.
-
[perPage]
String optionalNumber of records to display on page.
-
[page]
String optionalCurrent page to display on lookup window.
-
[sorting]
String optionalCurrent sorting.
-
[filter]
String optionalCurrent filter.
-
[filterCondition]
String optionalCurrent filter condition.
-
[predicate]
String optionalCurrent limit predicate.
-
[title]
String optionalTitle of modal lookup window.
-
[saveTo]
String optionalOptions to save selected lookup value.
-
[currentLookupRow]
String optionalCurrent lookup value.
-
[customPropertiesData]
String optionalCustom properties of modal lookup window.
-
[componentName]
String optionalComponent name of lookup component.
-
[notUseUserSettings]
Boolean optionalNot use user settings in the list component on lookup window.
-
_saveHasManyRelationships
-
model
model
recursively.
This method invokes by save
method.
Parameters:
-
model
DS.ModelRecord with hasMany relationships.
Returns:
actions.addColumnToSorting
-
column
Parameters:
-
column
ObjectColumn for sorting.
actions.close
-
skipTransition
-
rollBackModel
Handler for button 'Close' click. If return path is determined, an error is thrown because this action should not be triggered. Otherwise base logic is executed.
actions.delete
-
skipTransition
Handler for button 'Delete' click. If return path is determined and current model is saved, record marks as deleted and user is redirected to agregator's form. Otherwise base logic is executed.
Parameters:
-
skipTransition
BooleanIf
true
, then transition during close form process will be skipped after delete.
actions.dismissErrorMessages
()
public
actions.flexberryFileViewImageAction
-
selectedFileOptions
actions.groupEditRowClick
-
record
-
[options]
modelNoRollBack
to true
at current controller, redirects to detail's route, save necessary data to service.
Parameters:
-
record
Ember.ObjectRecord 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.previewLookupValue
-
previewData
Parameters:
-
previewData
ObjectLookup parameters: { recordId, transitionRoute, transitionOptions, showInSeparateRoute, projection, modelName, controller }.
actions.removeLookupValue
-
removeData
Parameters:
-
removeData
ObjectLookup parameters: { relationName, modelToLookup }.
actions.routeWillTransition
()
public
actions.save
()
Handler for button 'Save' click. If return path is determined, no rollback happens and user is redirected to agregator's form. Otherwise base logic is executed.
actions.saveAndClose
-
skipTransition
Handler for button 'Save and close' click. If return path is determined, no rollback happens and user is redirected to agregator's form. Otherwise base logic is executed.
Parameters:
-
skipTransition
BooleanIf
true
, then transition during close form process will be skipped after save.
actions.showLookupDialog
-
chooseData
lookupSettings.contentTemplate
on controller level (for example 'customlookupform');
3. If there has to be specific logic or properties on controller for template,
current lookup controller can be overriden (it is 'lookup-dialog' for edit forms),
new name can be set on lookup setting lookupSettings.controllerName
and new controller can be injected as lookupController
(if the controller was extended and not reopened).
Parameters:
-
chooseData
ObjectLookup parameters (projection name, relation name, etc).
actions.sortByColumn
-
column
Parameters:
-
column
ObjectColumn for sorting.
actions.updateLookupValue
-
updateData
Parameters:
-
updateData
ObjectLookup parameters to update data at model: { relationName, newRelationValue, modelToLookup }.
close
-
skipTransition
-
rollBackModel
Сlose edit form and transition to parent route.
closeModalDialog
()
Close current modal window if it exists.
closeModalDialog
()
Close current modal window if it exists.
createdModalDialog
-
modalDialog
Handles create modal window action. It saves created window to have opportunity to close it later.
Parameters:
-
modalDialog
JQueryCreated modal window.
createdModalDialog
-
modalDialog
Handles create modal window action. It saves created window to have opportunity to close it later.
Parameters:
-
modalDialog
JQueryCreated modal window.
delete
-
skipTransition
Delete object, if successful transition to parent route.
Parameters:
-
skipTransition
BooleanIf
true
, then transition during close form process will be skipped after delete.
Returns:
getCellComponent
-
attr
-
bindingPath
-
modelClass
Parameters:
Returns:
onDeleteActionFulfilled.
-
skipTransition
Parameters:
-
skipTransition
BooleanIftrue
, then transition during close form process (default behavior) will be skipped.
Example:
onDeleteActionFulfilled() {
alert('Delete operation succeed!');
this.close(false);
}
onDeleteActionRejected.
-
errorData
Parameters:
-
errorData
ObjectData about delete operation fail.
Example:
onDeleteActionRejected() {
alert('Delete operation failed!');
}
onDeleteActionStarted.
()
Example:
onDeleteActionStarted() {
alert('Delete operation started!');
}
onSaveActionAlways.
-
data
Parameters:
-
data
ObjectData about completed save operation.
Example:
onSaveActionAlways(data) {
alert('Save operation completed!');
}
onSaveActionFulfilled.
()
Example:
onSaveActionFulfilled() {
alert('Save operation succeed!');
}
onSaveActionRejected.
-
errorData
Parameters:
-
errorData
ObjectData about save operation fail.
Example:
onSaveActionRejected() {
alert('Save operation failed!');
}
onSaveActionStarted.
()
Example:
onSaveActionStarted() {
alert('Save operation started!');
}
openCreateModalDialog
-
modelController
-
editFormRoute
-
useSidePageMode
openEditModalDialog
-
record
-
editFormRoute
-
useSidePageMode
rollbackAll
()
rollbackHasManyRelationships
-
model
model
recursively.
This method invokes by resetController
in the edit-form
route.
Parameters:
-
model
DS.ModelRecord with hasMany relationships.
transitionToParentRoute
-
skipTransition
-
rollBackModel
Method to transit to parent's route (previous route).
If modelAgregatorRoute
is set, transition to defined path and set flag 'modelNoRollBack' to true
on controller to prevent rollback of model.
Then if parentRoute
is set, transition to defined path.
Otherwise transition to corresponding list.
validate
()
RSVP.Promise
Returns:
Properties
_EmberCpValidationsResultCollectionClass
Unknown
private
_openedModalDialog
JQuery
Current opened modal window.
Default: undefined
_openedModalDialog
JQuery
Current opened modal window.
Default: undefined
context
String
Default: '.ember-application > .ember-view'
controllerName
String
lookupController
.
destroyHasManyRelationshipsOnModelDestroy
Boolean
true
, all details will be deleted along with the main model.
Default: false
detachable
Boolean
Default: false
flexberryDetailInteractionService
Service
private
flexberryFileModalController
Controller
Default: Injected flexberry-file-view-dialog controller.
flexberryFileModalTemplateName
String
Default: 'flexberry-file-view-dialog'
lookupController
Ember.InjectedProperty
Default: Ember.inject.controller('colsconfig-dialog')
lookupEventsService
Service
lookupModalWindowPerPage
Number
Default: 5
lookupSettings
Object
modelNoRollBack
Boolean
Default: false
objectlistviewEvents
Service
queryParams
Array
Default: ['readonly']
readonlyAttr
String | Undefined
readonly
query param. According to the W3C standard, returns 'readonly' if readonly
is true
and undefined
otherwise.
TODO: Add unit test.
Default: undefined
returnToAgregatorRoute
Boolean
Flag to enable return to agregator's path if possible. It overrides base default value.
Default: true
saveBeforeRouteLeave
Boolean
Flag: indicates whether to save current model before going to the detail's route.
This flag is set to true
when this form is opened from agregator's form.
Default: false
validationModel
Any
Default: model
validationObject
Any
Default: model