APIs

Show:

Mixin for DS.Controller to support work with modal windows at lookups.

Methods

_reloadModalData

(
  • currentContext
  • options
)
private

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 String

    Current execution context of this method.

  • options Object

    Parameters to load proper data and to tune modal lookup window outlook.

    • [relatedToType] String optional

      Type of records to load.

    • [projectionName] String optional

      Projection name to load data by.

    • [perPage] String optional

      Number of records to display on page.

    • [page] String optional

      Current page to display on lookup window.

    • [sorting] String optional

      Current sorting.

    • [filter] String optional

      Current filter.

    • [filterCondition] String optional

      Current filter condition.

    • [predicate] String optional

      Current limit predicate.

    • [title] String optional

      Title of modal lookup window.

    • [saveTo] String optional

      Options to save selected lookup value.

    • [currentLookupRow] String optional

      Current lookup value.

    • [customPropertiesData] String optional

      Custom properties of modal lookup window.

    • [componentName] String optional

      Component name of lookup component.

    • [notUseUserSettings] Boolean optional

      Not use user settings in the list component on lookup window.

actions.previewLookupValue

(
  • previewData
)

Handlers action from FlexberryLookup preview action.

Parameters:

  • previewData Object

    Lookup parameters: { recordId, transitionRoute, transitionOptions, showInSeparateRoute, projection, modelName, controller }.

actions.removeLookupValue

(
  • removeData
)

Handlers action from FlexberryLookup remove action.

Parameters:

  • removeData Object

    Lookup 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:

  1. Create template with necessary content and set unique name for it (for example 'customlookupform.hbs');
  2. Override lookup setting 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 Object

    Lookup parameters (projection name, relation name, etc).

actions.updateLookupValue

(
  • updateData
)

Update relation value at model.

Parameters:

  • updateData Object

    Lookup parameters to update data at model: { relationName, newRelationValue, modelToLookup }.

reloadList

(
  • options
)
Promise public
It reloads data by parameters. This method is called to get data for flexberry-objectlistview (both on list-form and lookup modal window).

Parameters:

  • options Object
    Method options.
    • [modelName] String optional

      Type of records to load.

    • [projectionName] String optional

      Projection name to load data by.

    • [perPage] String optional

      Page size.

    • [page] String optional

      Current page.

    • [sorting] String optional

      Current sorting.

    • [filter] String optional

      Current filter.

    • [filterProjectionName] String optional

      Name 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 optional

      Predicate to limit records.

Returns:

Promise: A promise, which is resolved with a set of loaded records once the server returns.

Properties

contentTemplate

String

Name of template for content of modal window.

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

loaderTemplate

String

Name of template for content of loading modal window.

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.

modalDialogSettings

Object

Object with settings for modal window.

objectlistviewEvents

Class
Service that triggers objectlistview events.

Default: inject()

template

String

Name of template for modal window itself (not content of modal window).