v2.3.1
This commit is contained in:
31
demos/cases/GanttSort.jsx
Normal file
31
demos/cases/GanttSort.jsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import { useMemo } from 'react';
|
||||
import { getData, zoomConfig } from '../data';
|
||||
import { Gantt } from '../../src/';
|
||||
import './GanttSort.css';
|
||||
|
||||
function GanttSort({ skinSettings }) {
|
||||
const data = useMemo(() => getData(), []);
|
||||
|
||||
function init(api) {
|
||||
api.intercept('sort-tasks', (config) => {
|
||||
return config.key == 'text';
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="wx-fr1PMpDW demo">
|
||||
<h4>Sorting by the "Task Name" column only</h4>
|
||||
<div className="wx-fr1PMpDW gtcell">
|
||||
<Gantt
|
||||
init={init}
|
||||
{...skinSettings}
|
||||
tasks={data.tasks}
|
||||
links={data.links}
|
||||
zoom={zoomConfig}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default GanttSort;
|
||||
Reference in New Issue
Block a user