|
@@ -36,6 +36,9 @@ angular.module('luticateUtils')
|
36
|
36
|
if ($scope.tableOptions.perPage == null) {
|
37
|
37
|
$scope.tableOptions.perPage = 15;
|
38
|
38
|
}
|
|
39
|
+ if ($scope.tableOptions.query == null) {
|
|
40
|
+ $scope.tableOptions.query = "";
|
|
41
|
+ }
|
39
|
42
|
if ($scope.tableOptions.checkedItems == null) {
|
40
|
43
|
$scope.tableOptions.checkedItems = [];
|
41
|
44
|
}
|
|
@@ -51,6 +54,12 @@ angular.module('luticateUtils')
|
51
|
54
|
return false;
|
52
|
55
|
}
|
53
|
56
|
}
|
|
57
|
+ if ($scope.tableOptions.canFilter == null) {
|
|
58
|
+ $scope.tableOptions.canFilter = function()
|
|
59
|
+ {
|
|
60
|
+ return true;
|
|
61
|
+ }
|
|
62
|
+ }
|
54
|
63
|
var onItemClicked = $scope.tableOptions.onItemClicked;
|
55
|
64
|
$scope.tableOptions.onItemClicked = function(item)
|
56
|
65
|
{
|
|
@@ -81,7 +90,8 @@ angular.module('luticateUtils')
|
81
|
90
|
id: "promiseLoadItems_" + $scope.$id,
|
82
|
91
|
groups: [$scope.tableOptions.luBusy.group]
|
83
|
92
|
};
|
84
|
|
- $scope.tableOptions.getLoadPagePromise(page, $scope.tableOptions.perPage, promiseLoadItems)
|
|
93
|
+ $scope.tableOptions.getLoadPagePromise(page, $scope.tableOptions.perPage,
|
|
94
|
+ $scope.tableOptions.query, promiseLoadItems)
|
85
|
95
|
.then(function (items) {
|
86
|
96
|
$scope.tableOptions.page = page;
|
87
|
97
|
$scope.items = items;
|
|
@@ -93,8 +103,7 @@ angular.module('luticateUtils')
|
93
|
103
|
$scope.pages.push(i);
|
94
|
104
|
}
|
95
|
105
|
$scope.tableOptions.onPageChanged();
|
96
|
|
- }, function (error) {
|
97
|
|
- });
|
|
106
|
+ }, luticateDialogErrorHelper.errorDialog);
|
98
|
107
|
};
|
99
|
108
|
|
100
|
109
|
$scope.toggleCheckedItem = function (item) {
|
|
@@ -161,6 +170,8 @@ angular.module('luticateUtils')
|
161
|
170
|
angular.module('luticateUtils').run(['$templateCache', function($templateCache)
|
162
|
171
|
{
|
163
|
172
|
$templateCache.put('/luticate/lubasictable.html', '<div lu-busy="tableOptions.luBusy">' +
|
|
173
|
+'<div class="col-sm-3 pull-right" ng-show="tableOptions.canFilter()"><input placeholder="Filter" class="form-control" ng-model-options="{debounce: 500}" ' +
|
|
174
|
+ 'ng-model="tableOptions.query" ng-change="loadPage(0)"/></div>' +
|
164
|
175
|
' <table class="col-sm-12 table table-hover">' +
|
165
|
176
|
' <thead>' +
|
166
|
177
|
' <tr>' +
|