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

How to make gantt editable #246

Open
DamirMakhmudov opened this issue Apr 26, 2024 · 1 comment
Open

How to make gantt editable #246

DamirMakhmudov opened this issue Apr 26, 2024 · 1 comment

Comments

@DamirMakhmudov
Copy link

DamirMakhmudov commented Apr 26, 2024

Hi!
I have

import React from 'react';
import logo from './logo.svg';
import './App.css';
import { Gantt, Task, EventOption, StylingOption, ViewMode, DisplayOption } from 'gantt-task-react';
import "gantt-task-react/dist/index.css";

function App() {
  let tasks: Task[] = [
    {
      start: new Date(2020, 1, 1),
      end: new Date(2020, 1, 2),
      name: 'Idea',
      id: 'Task 0',
      type:'task',
      progress: 45,
      isDisabled: true,
      styles: { progressColor: '#ffbb54', progressSelectedColor: '#ff9e0d' },
    },
    {
      start: new Date(2020, 1, 4),
      end: new Date(2020, 1, 6),
      name: 'Idea 2',
      id: 'Task 1',
      type:'task',
      progress: 45,
      isDisabled: true,
      styles: { progressColor: '#ffbb54', progressSelectedColor: '#ff9e0d' },
    }
];
  return (
    <div className="App">
 <Gantt tasks={tasks} />

    </div>
  );
}

export default App;```

<img width="1004" alt="image" src="https://github.com/MaTeMaTuK/gantt-task-react/assets/49723817/296c93b3-6208-4968-a670-fa96b1a6f6f8">

I got gantt on for readonly
How to make it editable as I see on demo

<img width="1680" alt="image" src="https://github.com/MaTeMaTuK/gantt-task-react/assets/49723817/fb048c48-44c4-4f23-88f8-cd3f7f2fca98">
 
@kero-afro
Copy link

You can now edit it by adding onDateChange and onProgressChange events to Gantt by referring to the example in the link below.
https://github.com/MaTeMaTuK/gantt-task-react/blob/main/example/src/App.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants