1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- /**
- * Created by robin on 11/6/15.
- */
-
-
- angular.module('luticateUtils')
- .directive('luItemPicker', ['dialogs', 'luticateDialogErrorHelper',
- function(dialogs, luticateDialogErrorHelper) {
- return {
- restrict: 'E',
- scope: {
- options: '&',
- luModel: '&'
- },
- templateUrl: "views/itempicker.html",//"/luticate/luitempicker.html",
- link: function ($scope, element, attrs) {
- $scope.selectedItems = $scope.luModel();
-
- $scope.pickerOptions = $scope.options();
-
-
- }
- };
- }
- ]);
-
- angular.module('luticateUtils').run(['$templateCache', function($templateCache)
- {
- $templateCache.put('/luticate/luitempicker.html', '<div lu-busy="itemList">' +
- ' <table class="col-sm-12 table table-hover">' +
- ' <thead>' +
- ' <tr>' +
- ' <th lu-show-permission="{{ tableOptions.permissions.del }}">' +
- ' <input type="checkbox" ng-click="toggleSelectAll()"' +
- ' ng-checked="selectedItems.length == items.Data.length && items.Data.length != 0">' +
- ' </th>' +
- ' <th class="col-sm-{{ col.width }}" ng-repeat="col in tableOptions.columns">{{ col.name }}</th>' +
- '</tr>' +
- '</thead>' +
- '<tbody>' +
- '<tr ng-repeat="item in items.Data" style="cursor: pointer" ng-click="displayItem(item)">' +
- ' <td lu-show-permission="{{ tableOptions.permissions.del }}">' +
- ' <input name="selectedItems[]" type="checkbox" ng-checked="isItemChecked(item)"' +
- ' ng-click="$event.stopPropagation();toggleSelectedItem(item)" >' +
- ' </td>' +
- ' <td ng-repeat="col in tableOptions.columns">{{ col.getValue(item) }}</td>' +
- '</tr>' +
- '</tbody>' +
- '</table>' +
-
- '<div class="col-sm-12 text-center">' +
- ' <a class="{{ p == page ? \'pagination-current\' : \'pagination-not-current\'}}" href="" ng-repeat="p in pages" ng-click="loadPage(p)">{{ p + 1 }} </a>' +
- '</div>' +
-
- '<div class="col-sm-12">' +
- ' <button class="btn btn-default" type="button" ng-click="removeItems()"' +
- 'ng-disabled="selectedItems.length == 0" lu-show-permission="{{ tableOptions.permissions.del }}">' +
- ' <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Remove' +
- ' </button>' +
- ' <button class="btn btn-default" type="button" ng-click="addItem()" lu-show-permission="{{ tableOptions.permissions.add }}">' +
- ' <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add' +
- ' </button>' +
- ' </div>' +
- ' </div>');
- }]);
|