Upadte executed only once for task when using custom router object in createDataProcessor method


#1

I’ve create github issue as well here: https://github.com/DHTMLX/gantt/issues/42

Hi! I’d like to report a buggy behavior in data processor.

According to the docs, you can pass an object or a function to createDataProcessor() method. I choosed to use an object as follows:

.

And I noticed strange behavior of data processor - the update() function is executed only once per task! It means that first update invokes the update() function, but any other update does not invoke update() function anymore for this particular task.

I managed to fix the issue by passing function parameter in createDataProcessor() as below:

I believe this is a bug in your library. It hapens for update function only (create and delete works fine). Could you please take a look?

Buggy code: https://pastebin.com/QJV8TDwP
Working code: https://pastebin.com/MYwxszS1

I’m using pro 6.2.3 version.

Regards,
MP


#2

Hello Marcin,
Thank you for sending your code.
The following article has examples of how to use the createDataProcessor function:
https://docs.dhtmlx.com/gantt/api__gantt_createdataprocessor.html
If I apply that code, I don’t have the issue you describe:
https://files.dhtmlx.com/30d/b97de6fbfb3173efea81332d2bc99ac0/vokoscreen-2019-09-09_14-59-30.avi
http://snippet.dhtmlx.com/ecc8602d0

I tried to add your code in the snippet, but I had to modify it to make it work. After that, I cannot reproduce the issue:
https://files.dhtmlx.com/30d/09440780dd1b5ba1e15137c15d6d1cdb/vokoscreen-2019-09-09_15-07-41.avi
http://snippet.dhtmlx.com/bcbf52449

It is hard to suggest what might be wrong, as I don’t see your code, and I couldn’t reproduce the issue locally. Please, reproduce the issue in the snippet, then click on the “Share” button and send me the link.


#3

Hi @ramil ,

thank you for your reply. The issue is not a problem anymore. It got fixed after couple of code updates and after updating DHTMLX Gantt to latest version. I can try to track it down and see if it was previous library version which caused the problem or our code, if it’s important for you.

Regards,
MP


#4

hi,
i applied the same code and got the error, please provide a good solution to this read on routers


#5

Hello Sam,
It is hard to suggest what might be wrong as I don’t see your code.

Please, reproduce the issue in the snippet, then click on the “Share” button and send me the link:
https://snippet.dhtmlx.com/38ee1b370
Or send me an HTML file with all the necessary Javascript and CSS files.


#6

Hello,
The dev team fixed the bug when the Data Processor didn’t work correctly for the tasks after receiving a rejected promise:
https://docs.dhtmlx.com/gantt/whatsnew.html#701
You can see how it now works in the following snippet:
http://snippet.dhtmlx.com/5/6292d8525