1
甘特圖中的角度如何添加上下文菜單,任務像下面的圖片如何添加上下文菜單中的甘特圖
我現在的任務就是這樣
而且我已經在HTML中包括的JavaScript答css文件像下面
<link rel="stylesheet" href="bower_components/angular-gantt/dist/angular-gantt.min.css"/>
<link rel="stylesheet" href="bower_components/angular-gantt/dist/angular-gantt-plugins.min.css"/>
<script src="bower_components/angular-gantt/dist/angular-gantt.min.js"></script>
<script src="bower_components/angular-gantt/dist/angular-gantt-plugins.min.js"></script>
代碼: HTML:
<div gantt data="data" api="registerApi">
<gantt-table enabled="true" headers="columnsHeaders">
</gantt-table>
<gantt-groups></gantt-groups>
<gantt-tooltips></gantt-tooltips>
<gantt-bounds></gantt-bounds>
<gantt-progress></gantt-progress>
<gantt-sortable></gantt-sortable>
<gantt-movable ></gantt-movable>
<gantt-draw-task ></gantt-draw-task>
<gantt-resize-sensor ></gantt-resize-sensor>
<gantt-overlap></gantt-overlap>
</div>
</div>
控制器:
app.controller('historyController',function($scope,$http){
$scope.registerApi = function(api) {
api.core.on.ready($scope, function() {
api.tasks.on.resizeEnd($scope, function(data) {
console.log(data.model.name);
console.log(data.model.from);
console.log(data.model.to);
});
});
api.directives.on.new($scope, function(dName, dScope, dElement, dAttrs, dController) {
console.log(dName)
console.log(dScope);
console.log(dElement);
console.log(dAttrs);
console.log(dController);
});
}
$scope.scale="day";
$scope.data = [{name: 'Milestones', height: '3em', sortable: false, classes: 'gantt-row-milestone', color: '#45607D', tasks: [
// Dates can be specified as string, timestamp or javascript date object. The data attribute can be used to attach a custom object
{name: 'Kickoff', color: '#93C47D', from: '2013-10-07T09:00:00', to: '2013-10-07T10:00:00', data: 'Can contain any custom data or object'},
{name: 'Concept approval', color: '#93C47D', from: new Date(2013, 9, 18, 18, 0, 0), to: new Date(2013, 9, 18, 18, 0, 0), est: new Date(2013, 9, 16, 7, 0, 0), lct: new Date(2013, 9, 19, 0, 0, 0)},
{name: 'Development finished', color: '#93C47D', from: new Date(2013, 10, 15, 18, 0, 0), to: new Date(2013, 10, 15, 18, 0, 0)},
{name: 'Shop is running', color: '#93C47D', from: new Date(2013, 10, 22, 12, 0, 0), to: new Date(2013, 10, 22, 12, 0, 0)},
{name: 'Go-live', color: '#93C47D', from: new Date(2013, 10, 29, 16, 0, 0), to: new Date(2013, 10, 29, 16, 0, 0)}
], data: 'Can contain any custom data or object'},
{name: 'Status meetings', tasks: [
{name: 'Demo #1', color: '#9FC5F8', from: new Date(2013, 9, 25, 15, 0, 0), to: new Date(2013, 9, 25, 18, 30, 0)},
{name: 'Demo #2', color: '#9FC5F8', from: new Date(2013, 10, 1, 15, 0, 0), to: new Date(2013, 10, 1, 18, 0, 0)},
{name: 'Demo #3', color: '#9FC5F8', from: new Date(2013, 10, 8, 15, 0, 0), to: new Date(2013, 10, 8, 18, 0, 0)},
{name: 'Demo #4', color: '#9FC5F8', from: new Date(2013, 10, 15, 15, 0, 0), to: new Date(2013, 10, 15, 18, 0, 0)},
{name: 'Demo #5', color: '#9FC5F8', from: new Date(2013, 10, 24, 9, 0, 0), to: new Date(2013, 10, 24, 10, 0, 0)}
]]
我新的角度。
你試圖請提供代碼。 –
誰在這裏投票?不要像Facebook那樣投票贊成,只要一個女孩發佈任何類型的帖子,直到問題不夠詳細。 :P –
哈哈@RameshRajendran:D –