Ext Gantt: The New Task Split Feature

Sometimes a task is not worked on continuously, the work may be stopped as planned or due to unexpected circumstances. Let’s say a machine breaks down, in such a scenario the Ext Gantt supports splitting the task into segments. The easiest way to split a task is to use the new context menu option. Simply right click on the task where you want the split to happen and choose the “Split task” option.

Screen Shot 2014-11-07 at 09.16.41

The ‘split’ API method

You can of course also call the ‘split‘ method of the Gnt.model.Task class. Here’s how you call the split method manually:

All you have to do is to provide the date when you want the split to be made. By default, a gap of 1 task ‘duration unit’ will be introduced after the split. The second split in the example above will hence start on November 5. You can control the gap by passing two additional parameters after the split date, one for the duration, and another argument for the duration unit.

The ‘merge’ API method

Merging a split tasks is just as easy as splitting. Simply drag two pieces together in the UI and they will be merged automatically. You can of course do the same via the merge method of the Task API:

Data Structure

When loading data with segmented tasks, the incoming JSON structure should look like this:

It’s pretty self explanatory, you simply describe the segments in order with a date and duration (and optional duration unit). Note that the segments themselves are not part of the TaskStore directly, and can only be queried on the task level. The same structure as above will be used when tasks are serialized and sent to the server to be saved.

Try it out right now!

To try this feature out and do your own first task split, head over to our advanced and right click one of the tasks. Happy splitting!

Leave a Comment