FlexberryObjectlistviewRouteMixin Class
Mixin for DS.Route to support work with FlexberryObjectlistviewComponent.
Item Index
Methods
actions.objectListViewRowClick
(
public
-
record
Table row click handler.
Parameters:
-
record
EmberObjectRecord related to clicked table row
actions.refreshList
()
public
This action is called when user click on refresh button.
objectListViewLimitPredicate
(
BasePredicate
public
-
options
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:
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;
}
});