SearchKit - Refactor sort-related functions into a trait
[civicrm-core.git] / ext / search_kit / ang / crmSearchDisplayList / crmSearchDisplayList.component.js
1 (function(angular, $, _) {
2 "use strict";
3
4 angular.module('crmSearchDisplayList').component('crmSearchDisplayList', {
5 bindings: {
6 apiEntity: '@',
7 search: '<',
8 display: '<',
9 apiParams: '<',
10 settings: '<',
11 filters: '<'
12 },
13 require: {
14 afFieldset: '?^^afFieldset'
15 },
16 templateUrl: '~/crmSearchDisplayList/crmSearchDisplayList.html',
17 controller: function($scope, $element, searchDisplayBaseTrait) {
18 var ts = $scope.ts = CRM.ts('org.civicrm.search_kit'),
19 // Mix in properties of searchDisplayBaseTrait
20 ctrl = angular.extend(this, searchDisplayBaseTrait);
21
22 this.$onInit = function() {
23 this.initializeDisplay($scope, $element);
24 };
25
26 // Refresh current page
27 this.refresh = function(row) {
28 ctrl.runSearch();
29 };
30
31 }
32 });
33
34 })(angular, CRM.$, CRM._);