Load Json file is not working

Hi,

I’m trying to read data from Json file but I cannot read. The message shown in red is: “Invalid data”

Can you help me?

Thanks!

I’m using the example of the package called: 01_Initialization/02_load_json

Hi,
the example works both online and in package that is available on dhtmlx site
dhtmlx.com/docs/products/dhtmlxGantt/index.shtml
docs.dhtmlx.com/gantt/samples/01 … _json.html

Probably you opening the page as file, in this case ajax loading won’t work in most browsers (if page url in browser starts with “file:///” - this is the case)

The samples are expected to be opened from a web server

Oh, perfect.

Thank you very much!

I was wondering about a tutorial of “How to implement a Gantt chart into an asp.net MVC application”, reading data from a MS SQL Server database; what I know is that the connector and the dataProcessor are not available now… but Can I read data from a Database?

Thanks and regards,

Solano

Hi,
dataProcessor works on client side and is available.
As for server-side connector for gantt in ASP.NET, it is not implemented yet.

Did you check “Step 3 – Loading Data” of the article? There is an example how to load database data using Entity Framework.

If you do not use EF, the approach will be similar - you read records from a ‘tasks’ and a ‘links’ tables and output them to the client as a JSON string. Format described here

docs.dhtmlx.com/gantt/desktop__s … .html#json

Oh, thank you very much.

I really appreciate your feedback.

I understand now how to create the JSON and load it in my Gantt Chart.

I’m new using asp.net MVC, and I haven’t find a “tutorial” or example of how to use dataProcessor for Gantt Chart. Can you help me please?

Thanks so much.

If you mean a basic saving changes to the server, then all that is needed to do with the dataProcessor on the client-side is to initialize it. Dataprocessor traces the changes on the client side and sends updates to the server automatically.

All required code is described in ‘Client side’ paragraph of this article
docs.dhtmlx.com/gantt/desktop__s … #technique

Or in after this line ‘Add the following lines to the ent of the main.js file:’ of ‘Step 4 – Saving Changes to the Database’ paragraph of the blog article
dhtmlx.com/blog/?p=2250

Once initialized, dataProcessor will send updates to the server in format described in ‘Step 4’ of the blog article. Server side must process changes and send a response in expected format.

I’m sorry but I’m a little confused:

-I am filling Gantt using two ways:

  1. Using json file
  2. Sending from my controller a viewdata to the view in my asp.net mvc app

I think that in both cases I can use the dataProcessor.

Hugo

Hi,
I think we mean different things.
dhtmxlDataProcessor can be used only for sending updates to the server (for sending delete/update/insert informatin), it is not used for data loading
docs.dhtmlx.com/doku.php?id=dhtm … cessor:toc