bryntum / support

An issues-only repository for the Bryntum project management component suite which includes powerful Grid, Scheduler, Calendar, Kanban Task Board and Gantt chart components all built in pure JS / CSS / TypeScript
https://www.bryntum.com
54 stars 6 forks source link

`propagate` suspends `add` event on the store #9800

Open bmblb opened 3 months ago

bmblb commented 3 months ago

Reported here: https://forum.bryntum.com/viewtopic.php?f=52&t=30061&p=152547#p152547

Reproducible on advanced Gantt demo.

  1. Replace on add task click handler

    async onAddTaskClick() {
    const
        { gantt } = this,
        added     = gantt.taskStore.rootNode.appendChild({ name : this.L('New task'), duration : 1 });
    
    // run propagation to calculate new task fields
    // await gantt.project.commitAsync();
    
    await gantt.project.propagate();
    
    // scroll to the added task
    await gantt.scrollRowIntoView(added);
    
    gantt.features.cellEdit.startEditing({
        record : added,
        field  : 'name'
    });
    }
  2. add beforeAdd and add event listeners to the task store
  3. run the demo, click add button

Note, only beforeAdd is triggered. If you call commitAsync() add event will be unblocked.

This method is not used anywhere but it is public. It should probably just become an alias to commitAsync(), deprecated and then removed altogether.