Skip to content
Snippets Groups Projects
Commit d38a1e19 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

Task #8574: Render tasks in grid as tree view. Not optimal for user. Let's...

Task #8574: Render tasks in grid as tree view. Not optimal for user. Let's change this to a task-type-column.
parent 4c70dcfa
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,6 @@
var app = angular.module('raeApp',
['ngTouch',
'ui.grid',
'gantt',
'gantt.table',
'gantt.movable',
......
// $Id: controller.js 32761 2015-11-02 11:50:21Z schaap $
var gridControllerMod = angular.module('GridControllerMod', ['DataControllerMod']);
var gridControllerMod = angular.module('GridControllerMod', ['ui.grid', 'ui.grid.treeView']);
gridControllerMod.controller('GridController', ['$scope', 'dataService', function($scope, dataService) {
gridControllerMod.controller('GridController', ['$scope', 'dataService', 'uiGridTreeViewConstants', function($scope, dataService, uiGridTreeViewConstants) {
$scope.dataService = dataService;
$scope.$watch('dataService.tasks', function() {
if('tasks' in $scope.dataService && $scope.dataService.tasks.length > 0)
$scope.gridOptions.data = $scope.dataService.tasks[0]['tasks'];
{
var taskList = [];
for ( var i = 0; i < $scope.dataService.tasks.length; i++ ){
var node = $scope.dataService.tasks[i];
node.$$treeLevel = 0;
taskList.push(node);
var nodeTasks = node['tasks'];
for ( var j = 0; j < nodeTasks.length; j++ ){
nodeTasks[j].$$treeLevel = 1;
taskList.push(nodeTasks[j]);
}
}
$scope.gridOptions.data = taskList;
}
else
$scope.gridOptions.data = []
}, true);
......@@ -16,7 +29,9 @@ gridControllerMod.controller('GridController', ['$scope', 'dataService', functio
$scope.columns = [{ field: 'name' }, { field: 'from' }, { field: 'to' }];
$scope.gridOptions = {
enableSorting: true,
enableFiltering: true,
columnDefs: $scope.columns,
showTreeExpandNoChildren: false,
data: []
};
}
......
/* $Id: app.js 32724 2015-10-28 13:24:49Z schaap $ */
.myGrid {
width: 500px;
min-height: 400px;
min-width: 500px;
height: auto;
width: auto;
}
.gantt {
......
......@@ -26,7 +26,7 @@
{% raw %}
<div ng-controller="GridController as gridCtrl">
<strong>Tasks:</strong>
<div id="grid1" ui-grid="gridOptions" ui-grid-move-columns class="grid"></div>
<div id="grid1" ui-grid="gridOptions" ui-grid-move-columns ui-grid-tree-view class="myGrid"></div>
</div>
<br/>
<br/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment