Our state of the art Gantt chart


Post by beotech »

Hi,

Is there a way to manage recurrent events in Bryntum Gantt, through a similar popup than the event editor in the Bryntum Scheduler when enableRecurringEvents is set to true?

Many thanks,


Post by mats »

Gantt does not handle recurring events I'm afraid, one task equals one row with one set of start / end dates. We might be able to look at this when we have split task feature implemented.


Post by beotech »

Thank you for your reply.

Is it possible to include RecurrenceCombo and RecurrenceLegendButton to the Gantt taskEditor, in order to retrieve recurrence parameters, including the RecurrenceModel, and use it to manage recurrent events with our own logic ?

scheduler_event_editor.png
scheduler_event_editor.png (54.67 KiB) Viewed 868 times

Here, a first try to add these two fields in our task editor :

private buildTaskEditorMenu() {
    return {
        disabled: true,
        items: {
            generalTab: {
                items: {
                    divider: false,
                    startDate: {
                        type: 'DateTimeField',
                        flex: '1 0 100%',
                        weekStartDay: 1,
                        showWeekColumn: true,
                        dateField: {
                            picker: {
                                showWeekColumn: true
                            }
                        }
                    },
                    endDate: {
                        type: 'DateTimeField',
                        flex: '1 0 100%',
                        weekStartDay: 1,
                        dateField: {
                            picker: {
                                showWeekColumn: true
                            }
                        }
                    },
                    recurrenceCombo: {
                        type: 'RecurrenceCombo'
                    },
                    editRecurrenceButton: {
                        type: 'RecurrenceLegendButton'
                    }
                }
            }
        }
    };
}
gantt_task_editor.png
gantt_task_editor.png (101.32 KiB) Viewed 868 times

Thanks.


Post by pmiklashevich »

Basically you're right. There are few notes though:

  • widget type should be in lowercase;
  • to fix datetime fields styles need to reset "cls" field;
  • legend button can be stretched with flex 1;
  • Missing text in the legend button is due to missing recurrence rule on the event. It shows text dynamically depending on the rule;
  • Localization should be provided for recurrence related widgets. Please search for "recurrence" in Scheduler/lib/Scheduler/localization/En.js file. Please see localization guide. https://www.bryntum.com/docs/gantt/#guides/customization/localization.md

For example, you can try in Gantt Basic demo:

import '../../lib/Scheduler/view/recurrence/field/RecurrenceCombo.js';
import '../../lib/Scheduler/view/recurrence/RecurrenceLegendButton.js';
....
new Gantt({
            features: {
                taskEdit: {
                    items: {
                        generalTab: {
                            items: {
                                divider: false,
                                startDate: {
                                    type: 'datetimefield',
                                    flex: '1 0 100%',
                                    cls: '',
                                    weekStartDay: 1,
                                    showWeekColumn: true,
                                    dateField: {
                                        picker: {
                                            showWeekColumn: true
                                        }
                                    }
                                },
                                endDate: {
                                    type: 'datetimefield',
                                    flex: '1 0 100%',
                                    cls: '',
                                    weekStartDay: 1,
                                    dateField: {
                                        picker: {
                                            showWeekColumn: true
                                        }
                                    }
                                },
                                recurrenceCombo: {
                                    type: 'recurrencecombo'
                                },
                                editRecurrenceButton: {
                                    type: 'recurrencelegendbutton',
                                    flex: 1
                                }
                            }
                        }
                    }
                }
            },

Even if our default UI components do not fit your needs, you can always develop the UI you need and add logic you want. Cheers!

Pavlo Miklashevych
Sr. Frontend Developer


Post by beotech »

Thank you for these informations, the RecurrentCombo and RecurrenceLegendButton are now well displayed.
Is it possible to link dynamically this combo with this button in the Gantt taskEditor, like in the Scheduler eventEditor ? And therefore have access to RecurrentEditor ?


Post by pmiklashevich »

Showing RecurrenceEditor is implemented in RecurringEventEdit mixin. This functionality is not supported by Gantt. We can help you with the implementation only as a part of professional services: https://www.bryntum.com/services/

Pavlo Miklashevych
Sr. Frontend Developer


Post by gregc »

I was about to ask these questions too :-) It would be very cool if it worked the same as the scheduler.


Post Reply