CNode

一个简单的甘特图 React 组件封装 gantt-for-react

分享
Hhustcc发布于9 年前最后回复9 年前3 回复8243 浏览0 收藏

Github 地址:gantt-for-react

Frappe Gantt components for React wrapper.

Build Status npm npm npm

1. install

npm install gantt-for-react

2. usage

Online demo see http://git.hust.cc/gantt-for-react/.

import React from 'react';
import ReactGantt from 'gantt-for-react';

<ReactGantt 
	tasks={this.getTasks()} 
	viewMode={this.state.viewMode}

    onClick={this._func} 
	onDateChange={this._func}
	onProgressChange={this._func}
	onViewChange={this._func} 
	customPopupHtml={this._html_func} />

Or you can see the code here.

3. component props

  • tasks (required, array)

The tasks array need to be show with gantt graph.

  • viewMode (required, string)

The view mode of gantt. Can be Quarter Day, Half Day, Day, Week, Month.

  • customPopupHtml (optional, func)

The popo html function, can be a function that returns html or a simple html string.

And** 4 event function props**: onClick, onDateChange, onProgressChange, onViewChange. Document can see here.

4. LICENSE

MIT @hustcc

查看回复

回复 (3)

D
del1214#1·9 年前

前几天刚好有甘特图的需求,感谢分享

H
hustcc#2·9 年前
引用 del1214前几天刚好有甘特图的需求,感谢分享

@del1214 我也是正好要做甘特图,所以封装的一个 react。原始的还是来自于开源。

B
burning0xb#3·9 年前

猴赛雷

参与回复
登录后即可参与回复。登录