In this nice example, dhtmlx.com/blog/using-dhtmlx … p-net-mvc/
with the solution at the end there?
when the solution gets run/F5 and launches, draws an empty Gantt, it takes about 10 seconds (very fast pc) and then the gantt data fills in. today, yesterday and yest - 2
where… WHERE does it get this?
I blocked/commented out the DAL
[code]
namespace Gantt.DAL
{
public class GanttInitializer : DropCreateDatabaseIfModelChanges
{
//protected override void Seed(GanttContext context)
//{
// List tasks = new List()
// {
// new Task() { Id = 1, Text = “Project #888i8902”, StartDate = DateTime.Today.AddDays(-3), Duration = 18, SortOrder = 10, Progress = 0.4m, ParentId = null },
// new Task() { Id = 2, Text = “Task #1”, StartDate = DateTime.Today.AddDays(-2), Duration = 8, SortOrder = 10, Progress = 0.6m, ParentId = 1 },
// new Task() { Id = 3, Text = “Task #2”, StartDate = DateTime.Today.AddDays(-1), Duration = 8, SortOrder = 20, Progress = 0.6m, ParentId = 1 }
// };
// tasks.ForEach(s => context.Tasks.Add(s));
// context.SaveChanges();
// List<Link> links = new List<Link>()
// {
// new Link() { Id = 1, SourceTaskId = 1, TargetTaskId = 2, Type = "1" },
// new Link() { Id = 2, SourceTaskId = 2, TargetTaskId = 3, Type = "0" }
// };
// links.ForEach(s => context.Links.Add(s));
// context.SaveChanges();
//}
}
}[/code]
which matches what comes up. I have gone into each file, each method, each ? and searched many hours on the solution.
in the HomeController.cs
[HttpGet]
public JsonResult Data3()
{
var jsonData = new
{
// create tasks array
data = (
from t in db.Tasks.AsEnumerable()
select new
{
id = t.Id,
text = t.Text,
start_date = t.StartDate.ToString("u"),
duration = t.Duration,
order = t.SortOrder,
I try to single step? the debugger stops at var jsonData = new, that entire block is a step. After it steps? there are 3 arrays with the 3 tasks. how? where? from what?
The goal is to pass in one database record’s reference to this so that it generates the json data and draws the Gantt; i was trying to understand how it works first, but its as if this empty invisible null instance of db.Tasks.AsEnumerable() somehow pulls in, from the air, 3 tasks references