Our state of the art Gantt chart


Post by SIM-LTD »

Hi,

Another issue, that was also declared in Scheduler.

both event "beforeAdd" & beforeEventAdd" are not fired for TaskSore in Gantt ?

See our screenshot and to reproduce it simply :
1) Run the online demo = https://www.bryntum.com/examples/gantt/advanced/
2) Add the code below
gantt.taskStore.on({
  add:(record) => {
     console.log('TaskStore Event ADD', record);  
   },
  beforeAdd:(record) => {
     console.log('TaskStore before ADD', record);  
   },
 beforeEventAdd:(record) => {
     console.log('TaskStore before Event ADD', record);  
   },
  });
A new release of the Gantt should be launched pretty soon! Will those issues be fixed?
Attachments
Capture d’écran 2019-08-01 à 17.46.15.png
Capture d’écran 2019-08-01 à 17.46.15.png (269.57 KiB) Viewed 1510 times

Post by Maxim Gorkovsky »

Hello.
I opened ticket for this issue: https://app.assembla.com/spaces/bryntum/tickets/8989-task-store-(tree-store)-does-not-fire-documented-beforeadd-event/details
Thank you for report.

As a workaround you may override appendChild method on a TaskModel class and trigger event.

Post by SIM-LTD »

Hi

No news about this issue "event "beforeAdd" & beforeEventAdd" are not fired in Gantt ?

The workaround we applied is :
gantt.taskStore.on({
     catchAll(event) {
        if(event.type ==='add'){
          console.log('Event Listener catch All (ADD TASK)....', event.type, event)
                        
         // Set some default values....
            event.records[0].iconCls  =  'b-fa b-fa-lock'; 
            event.records[0].draggable = false                   
            event.records[0].resizable  = false;
            .........
         }
       }
});
This is only way so far (even with the last Nightly release) to sept in, inside le lifecycle so as to adjust a couple of properties needed for our process.

The point is, we do not know if "catchAll" is not too powerful; in a nutshell, we wonder if this does not consume too much CPU or memory.
As a matter of fact, every single event fired will be caught; thus it may not be appropriate, but at least that work as we wanted to cath event before Gantt Task is being Added.

Let us know if you think that is too much and something lighter worth it until the issue is fixed.
Thank you

Post Reply