// a simple table that displays info about the selected task var TaskInfo = React.createClass({ // render a table if a task is selected render : function() { var html = this.props.task ?
Name:{this.props.task.get('Name')}
Start:{Ext.Date.format(this.props.task.get('StartDate'), 'Y-m-d')}
End:{Ext.Date.format(this.props.task.get('EndDate'), 'Y-m-d')}
:

Select a task to display info here.

; return (
{html}
); } }); // the outermost component, holds the gantt chart and a taskinfo table and ties them togheter var GanttDemoApp = React.createClass({ // no task selected on startup getInitialState : function() { return { selectedTask : null }; }, // event handler for task selection, store selected task in state (which triggers a rerender) handleTaskSelect : function(taskRecord) { this.setState({ selectedTask : taskRecord }); }, // event handler for add button, call method on gantt chart to add a new task handleAddClick: function() { this.refs.gantt1.addTask(); }, // renders a gantt chart, taskinfo table and a button to add new tasks render : function() { return (

React demo

This example demonstrates how Ext Gantt can be wrapped as an React component.

A blog post describing the example can be found here: https://www.bryntum.com/blog/using-ext-gantt-with-react

Source available here: https://www.bryntum.com/playpen/react/react.zip

{/* columns as children */}
); } }); ReactDOM.render( , document.getElementById('gantt-demo') );