Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reset draggable or linkable when modify item.draggable or item.linkable #TINFR-806 #488

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions example/src/app/gantt/gantt.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ export class AppGanttExampleComponent implements OnInit, AfterViewInit {
loading = false;

items: GanttItem[] = [
{ id: '000000', title: 'Task 0', start: 1627729997, end: 1627769997 },
{ id: '000000', title: 'Task 0', start: 1627729997, end: 1627769997, draggable: false, linkable: false },
// { id: '000001', title: 'Task 1', start: 1617361997, end: 1625483597, links: ['000003', '000004', '000000'], },
{ id: '000001', title: 'Task 1', start: 1617361997, end: 1625483597, links: ['000003', '000004', '0000029'] },
{ id: '000002', title: 'Task 2', start: 1610536397, end: 1610622797, progress: 0.5 },
{ id: '000001', title: 'Task 1', start: 1617361997, end: 1625483597, links: ['000003', '000004', '0000029'], draggable: false },
{ id: '000002', title: 'Task 2', start: 1617361997, end: 1625483597, progress: 0.5, linkable: false },
{ id: '000003', title: 'Task 3 (不可拖动)', start: 1628507597, end: 1633345997, itemDraggable: false },
{ id: '000004', title: 'Task 4', start: 1624705997 },
{ id: '000005', title: 'Task 5', start: 1628075597, end: 1629544397, color: '#709dc1' },
Expand Down Expand Up @@ -134,6 +134,13 @@ export class AppGanttExampleComponent implements OnInit, AfterViewInit {
}
});

setTimeout(() => {
this.items[0] = { ...this.items[0], draggable: true, linkable: true };
this.items[1] = { ...this.items[1], draggable: true, linkable: false };
this.items[2] = { ...this.items[2], draggable: false, linkable: true };
this.items = [...this.items];
}, 5000);

console.log(this.items);
}

Expand Down
Loading