I am trying to create a simple example with DHTMLX Gantt on ASP.NET Blazor. I have managed to get it working until storing data in the database. Data get stored, but I am not able to load the chart on opening the page. Any ideas what might be the problem? I have gone through the documentation available, but I can’t find the root cause of this behavior.
This is how SQL Server looks like after triggering Save button on Gantt chart:
import 'https://cdn.dhtmlx.com/gantt/edge/dhtmlxgantt.js';
// ../gantt-master/codebase/dhtmlxgantt.js
// https://cdn.dhtmlx.com/gantt/edge/dhtmlxgantt.js
export function InitDHTML() {
// specifying the date format
gantt.config.date_format = "%Y-%m-%d %H:%i";
// initializing gantt
gantt.init("gantt_here");
// initiating data loading
gantt.load("/api/data");
// initializing dataProcessor
var dp = new gantt.dataProcessor("/api/");
// and attaching it to gantt
dp.init(gantt);
// setting the REST mode for dataProcessor
dp.setTransactionMode("REST");
}
Hello,
Thank you for the positive feedback.
When I try to run your code in Visual Studio, it tells me that some packages are not installed. When I agree to download them, Visual Studio Installer never finishes its job, and it doesn’t print any errors. If I try to run the project after restarting Visual Studio, I get an error message that the file `WebApplication2.Server.exe is missing, and there is no such file in that folder.
Thank you master, this worked! Blazor is rather new one out there. ASP.NET instruction worked fine with slight edits tho.
For repo on GitHub. I have just tested it with latest Visual Studio. Opened repo and selected open with Visual Studio and added it as a new folder (new repo on my computer). It opens without issues.
Just as a notice, I think there is a typo in instructions, underscore “_”. You also don’t have it in your example repo on GItHub (code does not compile, should be just “return …”).
P.S. You don’t need to answer to this question, as it is a little bit off-topic. Maybe I better to create separate one? Anyway if you have time at some point, what is the preferred way of building SQL structure in case I would have different projects and for each project there will be own Gantt chart?
Just as a notice, I think there is a typo in instructions, underscore “_”. You also don’t have it in your example repo on GItHub (code does not compile, should be just “return …”).
Thank you for letting us know about that issue. I added it to our internal bug tracker. We’ll fix that in the future.
P.S. You don’t need to answer to this question, as it is a little bit off-topic. Maybe I better to create separate one? Anyway if you have time at some point, what is the preferred way of building SQL structure in case I would have different projects and for each project there will be own Gantt chart?
It would be better to create a different topic for a different question.
Anyway, if you want to use the same database, you will need to create different tables. Then, depending on the project you load, you need to change the variable that will define which tables should be loaded.
Here is an example:
Unfortunately, I don’t have a ready demo.
1 Like
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan