Remote Data format

I've just started playing with gantt chart and can't get over an issue with remote data loading:
1. Documentation doesn't clearly state in what format the data needs to be returned...
 var data = new ej.data.DataManager({
      url: tasksUrl,
      adaptor: new ej.data.WebApiAdaptor(),
      crossDomain: false
  });
  
the tasks servlet gets invoked and returns the json data as:
[{"TaskID":"6223462473398594","TaskName":"Start ECC and BW after Maintenance","StartDate":"2021-04-27 01:18:17","Duration":10},{"TaskID":"6223465848629159","TaskName":"Start","StartDate":"2021-04-27 01:18:17","Duration":10,"parentID":"6223462473398594"},{"TaskID":"6223466504900046","TaskName":"Start ECC","StartDate":"2021-04-27 01:18:17","Duration":10,"parentID":"6223462473398594","Predecessor":"6223465848629159"},{"TaskID":"6223467997600720","TaskName":"Check ECC SAP Process","StartDate":"2021-04-27 01:18:17","Duration":10,"parentID":"6223462473398594","Predecessor":"6223466504900046"},{"TaskID":"6223468325195833","TaskName":"Complete SAP Startup","StartDate":"2021-04-27 01:18:17","Duration":10,"parentID":"6223462473398594","Predecessor":"6223467997600720"}]

But no data displayed in the gantt chart and no errors in the console...

2. It is unclear what date/time format is supported for parsing the remote data and if this is configurable/customizable

Help appreciated, thx David



7 Replies 1 reply marked as answer

PP Pooja Priya Krishna Moorthy Syncfusion Team April 27, 2021 10:21 AM UTC

Hi David, 
Please find the below response. 
S.No 
Query 
Syncfusion Comments 
 
1 
 
Documentation doesn't clearly state in what format the data needs to be returned 
 
We are sorry for the inconvenience caused. We will include about WebApiAdaptor in our documentation and it will get refreshed in live as soon as possible. Now, for your convenient we have prepared a sample and you can get it from below link. 
 
We need to return JSON object with properties Items and Count as shown in below documentation. 
 
 
2 
 
It is unclear what date/time format is supported for parsing the remote data and if this is configurable/customizable 
 
 
Do you mean, changing the date format in Grid cells and in tooltip. If yes, by using the dateFormat property, we can specify different date formats. 
Also please refer the below document link also. 
 
 

 
                             
 
Regards, 
Pooja K. 
 


Marked as answer

DS David Stavisski April 28, 2021 04:22 AM UTC

Thx Pooja, this is helpful, the 2) question was about how to tell DataManager which Date/Time format to use to parse the data sent by the server  - StartDate/EndDate (assuming adaptor = WebApiAdaptor or UrlAdaptor) I think this is what preventing the entries being parsed successfully (would be nice to get error messages at least)

Thx, David



MS Monisha Sivanthilingam Syncfusion Team April 28, 2021 10:53 AM UTC

Hi David, 
 
In general, the dates are sent to the server in the Universal format (i.e.)., UTC format. For example: 2021-12-31T06:00:00.000Z. 
 
Currently, we do not have support managing date objects over different time zones. However, we have already logged a feature report for it and you can track its status from the below feedback link. 
 
 
We will implement and include this feature in our upcoming 2021 Volume 1 SP release scheduled for the month of May 2021. 
 
We appreciate your patience until then. 
 
Regards, 
Monisha. 



DS David Stavisski April 28, 2021 05:14 PM UTC

Thanks, this is perfect, no real need for TimeZones in data loading - only needed for the presentation.
This said I am still not getting the data loaded although the backend servlet is invoked, no errors in the console..  can anyone look at the sample data and check if it is compliant? Using:

adaptor: new ej.data.WebApiAdaptor()

Data:

{"Items":[{"TaskID":"6223462473398594","TaskName":"Start ECC and BW after Maintenance","StartDate":"2021-04-28T16:58:20.704","Duration":10},{"TaskID":"6223465848629159","TaskName":"Start","StartDate":"2021-04-28T16:58:20.704","Duration":10,"ParentId":"6223462473398594"},{"TaskID":"6223466504900046","TaskName":"Start ECC","StartDate":"2021-04-28T16:58:20.704","Duration":10,"ParentId":"6223462473398594","Predecessor":"6223465848629159"},{"TaskID":"6223467997600720","TaskName":"Check ECC SAP Process","StartDate":"2021-04-28T16:58:20.704","Duration":10,"ParentId":"6223462473398594","Predecessor":"6223466504900046"},{"TaskID":"6223468325195833","TaskName":"Complete SAP Startup","StartDate":"2021-04-28T16:58:20.704","Duration":10,"ParentId":"6223462473398594","Predecessor":"6223467997600720"}],"Count":5}

I got the same setup working with Dhtmlx Gantt Control in 1/2 hour - although I like Syncfusion UI better this is proving a frustrating experience so far



MS Monisha Sivanthilingam Syncfusion Team April 29, 2021 01:19 PM UTC

Hi David, 
 
You are welcome. 
 
We checked with the data you shared and it is compliant with our Gantt. Please ensure that the mapping of the taskfields match in the following cases.  
 
Index.cshtml 
taskFields: { 
    id: 'TaskID', 
    name: 'TaskName', 
    startDate: 'StartDate', 
    duration: 'Duration', 
    parentID: 'ParentId', 
    dependency: 'Predecessor' 
} 
 
new GanttDataSource(){ 
   TaskID = 6223465848629159, 
   TaskName = "Identify Site location", 
   StartDate = "2019-03-29T16:58:20.704", 
   Duration = "2", 
   ParentId = 6223462473398594 
} 
 
public class GanttDataSource 
{ 
   public long TaskID { get; set; } 
   public string TaskName { get; set; } 
   public string StartDate { get; set; } 
   public string Duration { get; set; } 
   public string Predecessor { get; set; } 
   public long ParentId { get; set; } 
} 
 
Please contact us if the issue persists. 
 
Regards, 
Monisha. 



DS David Stavisski April 29, 2021 11:37 PM UTC

Thx, Found the issue - there was a discrepancy between task id field declared as "TaskId:" but the data returning as "TaskID:"
It works now, thanks for you support


PN Preethi Nesakkan Gnanadurai Syncfusion Team April 30, 2021 10:05 AM UTC

Hi David, 
  
We are glad to hear that your problem has been solved. 
  
Regards, 
Preethi 


Loader.
Up arrow icon