APIs

Show:

Mixin for DS.Route to support work with FlexberryObjectlistviewComponent.

Methods

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.

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;
                      }
                    });