Strange behavior on insert task

Hi,

I’m playing with Gantt objects and generally it works fine.
I’ve few question about the create task process:

  1. I add the insert login into the onLightboxSave event management, this because the onAfterTaskAdd was fired anyway before that the lightbox was shown. Anyway, the logic works fine.

  2. After the click on Save button, the lightbox keeps opened

  3. If I try to add a second task (or delete an existing one) after a 1st insertion I got the error:

TypeError: i is undefined
http://localhost/baango/dhtmlx/dhtmlxgantt.js
Line 6

and also some debug red popup appears on the top right saying “Undefined”.
What does that error means? How to switch the popups off?

  1. Even if I click on Cancel on the add task lightbox, a new task is added to the gantt

Thanks in advance,
Samuel

Q1,Q4. Currently adding a task goes in following sequence:

  1. Task is added to the gantt, it triggers onBeforeTaskAdd, onAfterTaskAdd events
  2. Then lightbox is opened
  3. If user clicks ‘Save’, onLIghtboxSave event is triggered
  4. If user clicks ‘Cancel’ - lightbox closes, task stays where it was

The later doesn’t seems like quite expected behavior, most probably it will be changed by version 2.2 of gantt

Q2. - Probably it happens due to some JS error that happens during the saving (maybe an error in custom handler of onLightboxSave).
Another possible reason - custom handler returns ‘false’ and prevents saving. Hard to tell more without any sample code or demo

Q3. - Sorry for the inconvenience, popups should be disabled in the release version. As a simple workaround you can add following code after adding dhtmlxgantt.js to the page: dhtmlx.assert = function(){};

However, the js error does not happens with our examples. If you provide a link to the page or code sample, I could try to reproduce the error

Hi, thanks for the reply.

Q1,Q4: waiting for the new release. Is there already any planned relase date for that?

Q2: Solved, I had the “return true” inside a jquery ajax callback function. As soon as I put it out side it, it worked fine.

Q3: the workedaround worked partially. No more red debug popup, but 1st add after 1st fails, the followings work fine. Is the fix release already planned?

Thanks in advance,
Samuel

Hello,
fixes will be released later today, or tomorrow morning

Is the fix already available?

Hi,
yes, you can download it from the component’s main page
dhtmlx.com/docs/products/dhtmlxGantt/index.shtml

Version number should be 2.1.1

Hi,

I just downloaded version 2.1.1 and have the same problem that lillo3.

Can you please help?

hi mcrodrig,
please check this post viewtopic.php?f=15&t=34442&p=111225#p111225