From: Bill Erickson Date: Tue, 7 Nov 2017 20:32:33 +0000 (-0500) Subject: egGrid column picker dialog WIP X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a7db86c23d33e51a596af7f2ae9ed9ec1c1b9d9a;p=working%2FEvergreen.git egGrid column picker dialog WIP Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/templates/staff/css/style.css.tt2 b/Open-ILS/src/templates/staff/css/style.css.tt2 index 74cf439656..b20f720244 100644 --- a/Open-ILS/src/templates/staff/css/style.css.tt2 +++ b/Open-ILS/src/templates/staff/css/style.css.tt2 @@ -473,6 +473,23 @@ table.list tr.selected td { /* deprecated? */ height: 25px; } +.eg-grid-columns-modal-body { + max-height: 400px; + overflow: scroll; +} + +.eg-grid-columns-modal-body .row { + padding: 2px 0px 2px 0px; + border-bottom: 1px solid #aaa; +} + +.eg-grid-columns-modal-body .visible { + color: rgb(51, 51, 51); + background-color: rgb(201, 221, 225); + border-bottom: 1px solid #888; +} + + eg-grid-field { display: none; } diff --git a/Open-ILS/src/templates/staff/share/t_autogrid.tt2 b/Open-ILS/src/templates/staff/share/t_autogrid.tt2 index e8f94d77bd..e8861a115f 100644 --- a/Open-ILS/src/templates/staff/share/t_autogrid.tt2 +++ b/Open-ILS/src/templates/staff/share/t_autogrid.tt2 @@ -190,6 +190,13 @@ [% l('Print Full Grid') %] +
  • + + + [% l('Configure Column Visibility') %] + +
  • +
  • + + + + diff --git a/Open-ILS/web/js/ui/default/staff/services/grid.js b/Open-ILS/web/js/ui/default/staff/services/grid.js index fab8679d69..b4e2c1e6b2 100644 --- a/Open-ILS/web/js/ui/default/staff/services/grid.js +++ b/Open-ILS/web/js/ui/default/staff/services/grid.js @@ -119,10 +119,10 @@ angular.module('egGridMod', controller : [ '$scope','$q','egCore','egGridFlatDataProvider','$location', 'egGridColumnsProvider','$filter','$window','$sce','$timeout', - 'egProgressDialog', + 'egProgressDialog','$uibModal', function($scope, $q , egCore, egGridFlatDataProvider , $location, egGridColumnsProvider , $filter , $window , $sce , $timeout, - egProgressDialog) { + egProgressDialog , $uibModal) { var grid = this; @@ -1077,6 +1077,28 @@ angular.module('egGridMod', }); } + $scope.showColumnDialog = function() { + return $uibModal.open({ + templateUrl: './share/t_grid_columns', + backdrop: 'static', + controller: ['$scope', '$uibModalInstance', + function($dialogScope, $uibModalInstance) { + // Passing the columns object directly into + // the dialog means any changes are applied + // directly to the column configs. If we need + // to support a "cancel" option, where applied + // changes are ignored, then angular.copy() + // the columns into the dialog then pull the + // values back out when saved. + $dialogScope.columns = $scope.columns; + $dialogScope.ok = function() { + $uibModalInstance.close() + } + } + ] + }); + }, + // generates CSV for the currently visible grid contents grid.generateCSV = function() { return grid.getAllItemsAsText().then(function(text_items) {