</div>
<div class="eg-grid-cell"
eg-grid-column-drag-dest
+ ng-class="{'eg-grid-column-last-mod' : lastModColumn==col.name}"
column="{{col.name}}"
eg-right-click="onContextMenu($event)"
ng-repeat="col in columns"
<div class="eg-grid-cell eg-grid-cell-conf-header">
<div class="eg-grid-conf-cell-entry">[% l('Expand') %]</div>
<div class="eg-grid-conf-cell-entry">[% l('Shrink') %]</div>
+ <div class="eg-grid-conf-cell-entry">[% l('Left') %]</div>
+ <div class="eg-grid-conf-cell-entry">[% l('Right') %]</div>
+ <div class="eg-grid-conf-cell-entry">[% l('Far Left') %]</div>
+ <div class="eg-grid-conf-cell-entry">[% l('Far Right') %]</div>
<div class="eg-grid-conf-cell-entry" ng-if="!disableMultiSort">[% l('Sort') %]</div>
</div>
<div class="eg-grid-cell"
<div class="eg-grid-conf-cell-entry">
<a href="" title="[% l('Make column wider') %]"
ng-click="modifyColumnFlex(col,1)">
- <span class="glyphicon glyphicon-fast-forward"></span>
+ <span class="glyphicon glyphicon-resize-full"></span>
</a>
</div>
<div class="eg-grid-conf-cell-entry">
<a href="" title="[% l('Make column narrower') %]"
ng-click="modifyColumnFlex(col,-1)">
+ <span class="glyphicon glyphicon-resize-small"></span>
+ </a>
+ </div>
+ <div class="eg-grid-conf-cell-entry">
+ <a href="" title="[% l('Move column left') %]"
+ ng-click="modifyColumnPos(col, -1)">
+ <span class="glyphicon glyphicon-backward"></span>
+ </a>
+ </div>
+ <div class="eg-grid-conf-cell-entry">
+ <a href="" title="[% l('Move column right') %]"
+ ng-click="modifyColumnPos(col, 1)">
+ <span class="glyphicon glyphicon-forward"></span>
+ </a>
+ </div>
+ <div class="eg-grid-conf-cell-entry">
+ <a href="" title="[% l('Move column far left') %]"
+ ng-click="modifyColumnPos(col, -10000)">
<span class="glyphicon glyphicon-fast-backward"></span>
</a>
</div>
+ <div class="eg-grid-conf-cell-entry">
+ <a href="" title="[% l('Move column far right') %]"
+ ng-click="modifyColumnPos(col, 10000)">
+ <span class="glyphicon glyphicon-fast-forward"></span>
+ </a>
+ </div>
<div class="eg-grid-conf-cell-entry" ng-if="!disableMultiSort">
<div ng-if="col.multisortable">
<input type='number' ng-model="col.sort"
column.flex = 1;
}
$scope.modifyColumnFlex = function(col, val) {
+ $scope.lastModColumn = col.name;
grid.modifyColumnFlex(col, val);
}
+ grid.modifyColumnPos = function(col, diff) {
+ var srcIdx, targetIdx;
+ angular.forEach(grid.columnsProvider.columns,
+ function(c, i) { if (c.name == col.name) srcIdx = i });
+
+ targetIdx = srcIdx + diff;
+ if (targetIdx < 0) {
+ targetIdx = 0;
+ } else if (targetIdx >= grid.columnsProvider.columns.length) {
+ // Target index follows the last visible column.
+ var lastVisible = 0;
+ angular.forEach(grid.columnsProvider.columns,
+ function(column, idx) {
+ if (column.visible) lastVisible = idx;
+ }
+ );
+ targetIdx = lastVisible + 1;
+ }
+
+ // Splice column out of old position, insert at new position.
+ grid.columnsProvider.columns.splice(srcIdx, 1);
+ grid.columnsProvider.columns.splice(targetIdx, 0, col);
+ }
+
+ $scope.modifyColumnPos = function(col, diff) {
+ $scope.lastModColumn = col.name;
+ return grid.modifyColumnPos(col, diff);
+ }
+
+
// handles click, control-click, and shift-click
$scope.handleRowClick = function($event, item) {
var index = grid.indexValue(item);
$scope.showGridConf = true;
}
+ delete $scope.lastModColumn;
$scope.gridColumnPickerIsOpen = false;
}