multiple initialization of same instance (angular + gantt)

Hello everybody,

I’m using angular + gantt.
I have 2 different views with 2 gantts.
Becouse of gantt object is a global variable I’m using the same object with different data, but there are some problem when I call multiple time gantt.init (I need to call it if I want to see the gantt…right?) and I have a dataProcessor attached.

The issue is that:

  • I init the first gant (all ok!)
  • I change view and I call the second time the init function (the gantt works but when i add a task TWO tasks appear on the gantt! -only one in the db-)

I need the pro edition or there is a way to fix it?

great! I fixed it!
the problem was the event attaching.
everytime you call gantt.init events are attached again so you’ll have multiple reactions.

I edited the main js file with something like:

if(typeof gantt.initialized === ‘undefined’){
//attachEvent
}

EVERYTIME i found gantt.attachEvent…
is not beoutifull but it works :slight_smile: