FlexberryLookupMixin Class
addon/mixins/flexberry-lookup-controller.js:18
Mixin for DS.Controller to support work with modal windows at lookups.
Item Index
Methods
Methods
_reloadModalData
-
currentContext
-
options
This method refreshes displayed data on lookup modal window.
It reloads current lookup modal window in order to show loading image. Then proper request to load data is formed (it considers current page, filter, etc). After the data loading data are displayed on lookup modal window.
This method is called during the first data loading and after each change of request parameters (current page, filter, etc) on lookup modal window controller (it is implemented by sending handler on this method to lookup modal window controller).
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.
-
actions.previewLookupValue
-
previewData
Handlers action from FlexberryLookup preview action.
Parameters:
-
previewData
ObjectLookup parameters: { recordId, transitionRoute, transitionOptions, showInSeparateRoute, projection, modelName, controller }.
actions.removeLookupValue
-
removeData
Handlers action from FlexberryLookup remove action.
Parameters:
-
removeData
ObjectLookup parameters: { relationName, modelToLookup }.
actions.routeWillTransition
()
Handlers corresponding route's willTransition action. It sends message about transition to showing lookup modal window controller.
actions.showLookupDialog
-
chooseData
Handles action from lookup choose action. It opens modal window where availible values are shown.
In order to customize content of all lookup modal window there is such a way:
- Create template with necessary content and set unique name for it (for example 'customlookupform.hbs');
- Override lookup setting
lookupSettings.contentTemplate
on controller level (for example 'customlookupform'); - 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 aslookupController
(if the controller was extended and not reopened).
Parameters:
-
chooseData
ObjectLookup parameters (projection name, relation name, etc).
actions.updateLookupValue
-
updateData
Update relation value at model.
Parameters:
-
updateData
ObjectLookup parameters to update data at model: { relationName, newRelationValue, modelToLookup }.
reloadList
-
options
Parameters:
-
options
ObjectMethod options.-
[modelName]
String optionalType of records to load.
-
[projectionName]
String optionalProjection name to load data by.
-
[perPage]
String optionalPage size.
-
[page]
String optionalCurrent page.
-
[sorting]
String optionalCurrent sorting.
-
[filter]
String optionalCurrent filter.
-
[filterProjectionName]
String optionalName of model projection which should be used for filtering throught search-element on toolbar. Filtering is processed only by properties defined in this projection.
-
[predicate]
String optionalPredicate to limit records.
-
Returns:
Properties
context
String
Modal context param. Selector or jquery object specifying the area to dim.
Default: '.ember-application > .ember-view'
controllerName
String
Name of controller that handles modal window.
Controller with the same name has to be injected to property lookupController
.
detachable
Boolean
Modal detachable param. If set to false will prevent the modal from being moved to inside the dimmer.
Default: false
lookupController
Controller
Controller to show modal window.
lookupEventsService
Service
Service that triggers lookup events.
lookupModalWindowPerPage
Number
Default number of records per page on lookup window list.
Default: 5
lookupSettings
Object
Lookup settings for modal window. It has to be overriden on controller where this mixin is used.
objectlistviewEvents
Class
Default: inject()