frappe / gantt

Open Source Javascript Gantt
https://frappe.io/gantt
MIT License
4.61k stars 1.02k forks source link

a React component. #10

Closed hustcc closed 7 years ago

hustcc commented 7 years ago

gantt-for-react is Frappe Gantt components for React wrapper.

Now is v0.0.1, just can use it in react, but need to upgrade, supports are needed.

I need to update the gantt when tasks updated, so I need an api

gantt.update_tasks(tasks);

to change the gantt dynamically. The api is similar with

gantt.change_view_mode('Week')

Can you do this to help ?

netchampfaris commented 7 years ago

Just pushed https://github.com/frappe/gantt/commit/ac374003906994340e8583e1a6af5d48947e99ec

hustcc commented 7 years ago

Thanks, let me do a test.

But I need a new version(v0.0.4) with new api,

hustcc commented 7 years ago

In addition, the 1st parameter should be compatible with selector string and dom object:

var gantt = new Gantt("#gantt", tasks);
// or
var gantt = new Gantt(document.getElementById('#gantt'), tasks);

then in react, I can use

var gantt = new Gantt(this.refs.ganttdom, tasks);

so, there will be no need to generate a unique id for react component dom.