|
@@ -10,6 +10,9 @@ angular.module('luticateUtils')
|
10
|
10
|
scope: {
|
11
|
11
|
options: '&'
|
12
|
12
|
},
|
|
13
|
+ transclude: {
|
|
14
|
+ 'lu-basic-table-filter': '?lu-basic-table-filter'
|
|
15
|
+ },
|
13
|
16
|
templateUrl: "/luticate/lubasictable.html",
|
14
|
17
|
link: function ($scope, element, attrs) {
|
15
|
18
|
$scope.items = [];
|
|
@@ -173,38 +176,39 @@ angular.module('luticateUtils')
|
173
|
176
|
|
174
|
177
|
angular.module('luticateUtils').run(['$templateCache', function($templateCache)
|
175
|
178
|
{
|
176
|
|
- $templateCache.put('/luticate/lubasictable.html', '<div lu-busy="tableOptions.luBusy">' +
|
177
|
|
-'<div class="col-sm-3 pull-right" ng-show="tableOptions.canFilter()"><input placeholder="Filter" class="form-control" ng-model-options="{debounce: 500}" ' +
|
178
|
|
- 'ng-model="tableOptions.query" ng-change="loadPage(0)"/></div>' +
|
179
|
|
-' <table class="col-sm-12 table table-hover">' +
|
180
|
|
-' <thead>' +
|
181
|
|
-' <tr>' +
|
182
|
|
-' <th ng-show="tableOptions.canCheck()">' +
|
183
|
|
-' <input type="checkbox" ng-click="toggleCheckAll()"' +
|
184
|
|
-' ng-checked="tableOptions.checkedItems.length == items.Data.length && items.Data.length != 0">' +
|
185
|
|
-' </th>' +
|
186
|
|
-' <th class="col-sm-{{ col.width }}" ng-repeat="col in tableOptions.columns">{{ col.name }}</th>' +
|
187
|
|
-'</tr>' +
|
188
|
|
-'</thead>' +
|
189
|
|
-'<tbody>' +
|
190
|
|
-'<tr ng-repeat="item in items.Data" ng-style="{\'cursor\': tableOptions.canClick(item) ? \'pointer\' : \'\'}" ng-click="onItemClicked(item)">' +
|
191
|
|
-' <td ng-show="tableOptions.canCheck()">' +
|
192
|
|
-' <input name="tableOptions.checkedItems[]" type="checkbox" ng-checked="isItemChecked(item)"' +
|
193
|
|
- ' ng-click="$event.stopPropagation();toggleCheckedItem(item)" >' +
|
194
|
|
-' </td>' +
|
195
|
|
-' <td ng-repeat="col in tableOptions.columns">{{ col.getValue(item) }}</td>' +
|
196
|
|
-'</tr>' +
|
197
|
|
-'</tbody>' +
|
198
|
|
-'</table>' +
|
199
|
|
-
|
200
|
|
- '<div class="col-sm-12 text-center">' +
|
201
|
|
-'<div class="pagination"><ul>' +
|
202
|
|
-' <li class="previous">' +
|
203
|
|
-' <a href="" class="fui-arrow-left" ng-click="loadPage(tableOptions.page - 1)"></a></li>' +
|
204
|
|
-' <li ng-repeat="p in pages" ng-class="{ \'active\' : p == tableOptions.page}">' +
|
205
|
|
-' <a href="" ng-click="loadPage(p)">{{ p + 1 }}</a></li>' +
|
206
|
|
-' <li class="next">' +
|
207
|
|
-' <a href="" class="fui-arrow-right" ng-click="loadPage(tableOptions.page + 1)"></a></li>' +
|
208
|
|
-'</ul></div></div>' +
|
209
|
|
-' </div>');
|
|
179
|
+ $templateCache.put('/luticate/lubasictable.html',
|
|
180
|
+'<div lu-busy="tableOptions.luBusy">' +
|
|
181
|
+' <div class="col-sm-9"><ng-transclude ng-transclude="lu-basic-table-filter"></ng-transclude></div>' +
|
|
182
|
+' <div class="col-sm-3" ng-show="tableOptions.canFilter()"><input placeholder="Filter" class="form-control" ng-model-options="{debounce: 500}" ' +
|
|
183
|
+' ng-model="tableOptions.query" ng-change="loadPage(0)"/></div>' +
|
|
184
|
+' <table class="col-sm-12 table table-hover">' +
|
|
185
|
+' <thead>' +
|
|
186
|
+' <tr>' +
|
|
187
|
+' <th ng-show="tableOptions.canCheck()">' +
|
|
188
|
+' <input type="checkbox" ng-click="toggleCheckAll()"' +
|
|
189
|
+' ng-checked="tableOptions.checkedItems.length == items.Data.length && items.Data.length != 0">' +
|
|
190
|
+' </th>' +
|
|
191
|
+' <th class="col-sm-{{ col.width }}" ng-repeat="col in tableOptions.columns">{{ col.name }}</th>' +
|
|
192
|
+' </tr>' +
|
|
193
|
+' </thead>' +
|
|
194
|
+' <tbody>' +
|
|
195
|
+' <tr ng-repeat="item in items.Data" ng-style="{\'cursor\': tableOptions.canClick(item) ? \'pointer\' : \'\'}" ng-click="onItemClicked(item)">' +
|
|
196
|
+' <td ng-show="tableOptions.canCheck()">' +
|
|
197
|
+' <input name="tableOptions.checkedItems[]" type="checkbox" ng-checked="isItemChecked(item)"' +
|
|
198
|
+' ng-click="$event.stopPropagation();toggleCheckedItem(item)" >' +
|
|
199
|
+' </td>' +
|
|
200
|
+' <td ng-repeat="col in tableOptions.columns">{{ col.getValue(item) }}</td>' +
|
|
201
|
+' </tr>' +
|
|
202
|
+' </tbody>' +
|
|
203
|
+' </table>' +
|
|
204
|
+' <div class="col-sm-12 text-center">' +
|
|
205
|
+' <div class="pagination"><ul>' +
|
|
206
|
+' <li class="previous">' +
|
|
207
|
+' <a href="" class="fui-arrow-left" ng-click="loadPage(tableOptions.page - 1)"></a></li>' +
|
|
208
|
+' <li ng-repeat="p in pages" ng-class="{ \'active\' : p == tableOptions.page}">' +
|
|
209
|
+' <a href="" ng-click="loadPage(p)">{{ p + 1 }}</a></li>' +
|
|
210
|
+' <li class="next">' +
|
|
211
|
+' <a href="" class="fui-arrow-right" ng-click="loadPage(tableOptions.page + 1)"></a></li>' +
|
|
212
|
+' </ul></div></div>' +
|
|
213
|
+'</div>');
|
210
|
214
|
}]);
|