DHTMLX / gantt

GPL version of Javascript Gantt Chart
https://dhtmlx.com/docs/products/dhtmlxGantt/
GNU General Public License v2.0
1.44k stars 320 forks source link

Issue with parse data get by axios #95

Open grifin85 opened 1 year ago

grifin85 commented 1 year ago

Hi, I use dhmlx-gantt: 8.0.1 free, for get data I use Axios, but when I try to parse data

gantt.parse({
data: array
});

I get the error: Cannot read properties of undefined (reading 'length'

If I use the load function from the same source it's ok or if I put this data how static also ok

MaksimLakatkouXBS commented 1 year ago

Hello, Unfortunately, it's hard to say what the problem might be without more details. Could you provide access to the application or send a test app so I can investigate further?

Here are a couple of examples: https://snippet.dhtmlx.com/tx1b4qr1 https://snippet.dhtmlx.com/e8cnbxs7

Perhaps they will be helpful for you.

Krishkumarchhabra25 commented 1 year ago

The gantt.parse() method expects an array of data to be provided, and it seems that it is encountering an issue when trying to access the 'length' property of the array

example- const array = [ { id: 1, text: "Task 1", start_date: "2023-08-03", duration: 5 }, { id: 2, text: "Task 2", start_date: "2023-08-08", duration: 3 }, ];

gantt.parse({ data: array, });

double check your code ,and have a look on your code and my code , is this similar or not if you will provide the code , i can go through that