APIs

Show:

Methods

_attributesForFilter

(
  • projection
  • store
)
Array private

Generates array attributes for filter.

Parameters:

Returns:

Array:

Array objects format: { name, type }, where name - attribute name, type - attribute type.

_filtersPredicate

() BasePredicate | Undefined private

Return predicate for QueryBuilder or undefined.

Returns:

BasePredicate | Undefined:

Predicate for QueryBuilder or undefined.

_getFilterPredicate

(
  • modelProjection
  • params
)
BasePredicate | Null private

It forms the filter predicate for data loading.

Parameters:

  • modelProjection Object

    A projection used for data retrieving.

  • params Object

    Current parameters to form predicate.

Returns:

BasePredicate | Null:

Filter predicate for data loading.

_invalidSorting

(
  • sorting
)
Boolean

Parameters:

Returns:

_normalizeNeqPredicate

(
  • predicate
)
Object private

Generates new predicate for neq value predicate.

Parameters:

Returns:

Object:

Normalized predicate.

actions.objectListViewRowClick

(
  • record
)
public

Table row click handler.

Parameters:

  • record EmberObject

    Record related to clicked table row

actions.refreshList

() public

This action is called when user click on refresh button.

model

(
  • params
  • transition
)

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

Parameters:

objectListViewLimitPredicate

(
  • options
)
BasePredicate public

It forms the limit predicate for loaded data.

By default it returns undefined. In order to set specific limit predicate, this method have to be overriden on applied-specific route.

Parameters:

  • options Object

    Method options

    • [modelName] String optional

      Type of records to load

    • [projectionName] String optional

      Projection name to load data by

    • [params] String optional

      Current route query parameters

Returns:

BasePredicate:

The predicate to limit loaded data

Example:

// app/routes/limit-function-example.js
                    import ListFormRoute from 'ember-flexberry/routes/list-form';
                    import { StringPredicate } from 'ember-flexberry-data/query/predicate';
                    
                    export default ListFormRoute.extend({
                      modelProjection: 'FolvWithLimitFunctionExampleView',
                    
                      modelName: 'ember-flexberry-dummy-suggestion',
                    
                      objectListViewLimitPredicate: function(options) {
                        let methodOptions = merge({
                          modelName: undefined,
                          projectionName: undefined,
                          params: undefined
                        }, options);
                    
                        if (methodOptions.modelName === this.get('modelName') &&
                            methodOptions.projectionName === this.get('modelProjection')) {
                          let currentPerPageValue = methodOptions.params ? methodOptions.params.perPage : undefined;
                          let limitFunction = (currentPerPageValue && currentPerPageValue % 2 === 0) ?
                                              new StringPredicate('address').contains('S') :
                                              new StringPredicate('address').contains('п');
                          return limitFunction;
                        }
                    
                        return undefined;
                      }
                    });
                    
                    

onModelLoadingAlways.

(
  • data
  • transition
)

This method will be invoked always when model loading operation completed, regardless of model loading promise's state (was it fulfilled or rejected). Override this method to add some custom logic on model loading operation completion.

Parameters:

  • data Object

    Data about completed model loading operation.

  • transition Transition

    Current transition object.

Example:

onModelLoadingAlways(data, transition) {
                      alert('Model loading operation completed!');
                    }
                    

onModelLoadingFulfilled.

(
  • model
  • transition
)

This method will be invoked when model loading operation successfully completed. Override this method to add some custom logic on model loading operation success.

Parameters:

  • model Object

    Loaded model data.

  • transition Transition

    Current transition object.

Example:

onModelLoadingFulfilled(model, transition) {
                      alert('Model loading operation succeed!');
                    }
                    

onModelLoadingRejected.

(
  • errorData
  • transition
)

This method will be invoked when model loading operation completed, but failed. Override this method to add some custom logic on model loading operation fail. By default showing error form.

Parameters:

  • errorData Object

    Data about model loading operation fail.

  • transition Transition

    Current transition object.

Example:

onModelLoadingRejected(errorData, transition) {
                      alert('Model loading operation failed!');
                    }
                    

onModelLoadingStarted.

(
  • queryParameters
  • transition
)

This method will be invoked before model loading operation will be called. Override this method to add some custom logic on model loading operation start.

Parameters:

  • queryParameters Object

    Query parameters used for model loading operation.

  • transition Transition

    Current transition object.

Example:

onModelLoadingStarted(queryParameters, transition) {
                      alert('Model loading operation started!');
                    }
                    

predicateForAttribute

(
  • attribute
  • filter
  • filterCondition
)
BasePredicate | Null

Create predicate for attribute. Can you overload this function for extended logic.

Default supported attribute types:

  • string
  • number

Parameters:

  • attribute Object

    Object contains attribute info.

    • name String

      Name of attribute, example name or type.name if it attribute of relationship.

    • options Object

      Object with attribute options.

      • [hidden] Boolean optional
        Flag, indicate that this hidden attribute.
      • [displayMemberPath] Boolean optional
        Flag, indicate that this attribute uses for display relationship.
    • type String

      Type of attribute, example string or number.

  • filter String

    Pattern for search.

  • filterCondition String

    Condition for predicate, can be or or and.

Returns:

BasePredicate | Null:

Object class of BasePredicate or null, if not need filter.

Example:

// app/routes/example.js
                    ...
                    // Add support for logical attribute
                    predicateForAttribute(attribute, filter) {
                      switch (attribute.type) {
                        case 'boolean':
                          let yes = ['TRUE', 'True', 'true', 'YES', 'Yes', 'yes', 'ДА', 'Да', 'да', '1', '+'];
                          let no = ['False', 'False', 'false', 'NO', 'No', 'no', 'НЕТ', 'Нет', 'нет', '0', '-'];
                    
                          if (yes.indexOf(filter) > 0) {
                            return new SimplePredicate(attribute.name, 'eq', 'true');
                          }
                    
                          if (no.indexOf(filter) > 0) {
                            return new SimplePredicate(attribute.name, 'eq', 'false');
                          }
                    
                          return null;
                    
                        default:
                          return this._super(...arguments);
                      }
                    },
                    ...
                    

predicateForFilter

(
  • filter
)
BasePredicate | Null

Builds predicate for filter.

Parameters:

  • filter Object

    Object ({ name, condition, pattern }) with parameters for filter.

Returns:

BasePredicate | Null:

Predicate to filter through.

Example:

// app/routes/example.js
                    ...
                    predicateForFilter(filter) {
                      if (filter.type === 'string' && filter.condition === 'like') {
                        return new StringPredicate(filter.name).contains(filter.pattern);
                      }
                    
                      return this._super(...arguments);
                    },
                    ...
                    

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.

setupController

(
  • controller
  • model
)

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

Parameters:

Properties

advLimit

AdvLimitService

Service for managing advLimits for lists.

appState

AppStateService

Service for managing the state of the application.

colsConfigMenu

Service

developerUserSettings

Object

Default: { DEFAULT: {} }

filter

String

String with search query.

Default: null

filterPredicate

BasePredicate

Result predicate with filters restrictions for olv.

Default: null

formLoadTimeTracker

FormLoadTimeTrackerService private

Link on .

modelName

String

Default: 'new-platform-flexberry-services-lock'

modelProjection

String

Default: 'LockL'

objectlistviewEvents

Class

Service that triggers objectlistview events.

Default: inject()

queryParams

Object

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

resultPredicate

BasePredicate

Result predicate with all restrictions for olv.

Default: null

sorting

Array

Current sorting.

Default: []