DataManager black box

Hi team,

We are finding it difficult to implement the DataManager datasource on the Gantt control,

Specifically we would like to capture the response of the data of the request and then process some of our own methods e.g. 

created() {
this.dataSourceManager = new DataManager({
url: '/SomeAPI/UrlDatasource?id=' + this.someId,
crossDomain: true,
adaptor: new UrlAdaptor,
});

this.dataSourceManager.executeQuery(new Query()).then((data) => {
this.bindMilestoneActivitiesToEventMarkers(data.result.result);
this.formatActivityDates(data.result.result);
this.ganttReady = true;

this.$emit('gantt-databound', data.result.result);
});
},


The problem with the above is that it makes 2 API requests to our backend. 

How can we achieve this in one single HTTP request.



5 Replies

PP Pooja Priya Krishna Moorthy Syncfusion Team April 14, 2021 01:14 PM UTC

Hi Samantha, 
Usually, while binding remote data only single request will be sent. But as you said two requests has been sent to the backend, we request you more details on this. 
We need to know, what you are trying to achieve in the method bindMilestoneActivitiesToEventMarkers and  formatActivityDates. 
Else it will be very helpful, if you share us issue reproducible sample to check from our end and provide you proper solution. 
  
Regards, 
Pooja K. 



SE Sean April 14, 2021 01:28 PM UTC

Hi Pooja, 

The purpose of what those two custom methods do are not really relevant. 

What we want and should be able to do is to get the API response data when DataManager is used. 

We currently have to make use of the executeQuery() to get access to the API response (which is what causes a second API request to be made). 

Anyway, to move this conversation along:
  • bindMilestoneActivitiesToEventMarkers()
    We have special tasks in our system that we want to link to eventMarkers, if these tasks have a finish date which is later than the event marker we highlight the task in red e.g. 


  • formatActivityDates()
    We have issues rendering the Gantt control, specifically with .NET Controller response payload dates and SyncFusion.
    We found that by converting all of our dates from the API response in string to JS dates fixed this issue. 

If you could please tell us how to access the data in a single HTTP request using DataManager that would be appreciated.



PP Pooja Priya Krishna Moorthy Syncfusion Team April 15, 2021 12:14 PM UTC

Hi Samantha, 
We have prepared a sample and bound the data to Gantt in executeQuery. But we are unable to replicate the reported error. Please find the tested sample link. 
Please share us the details about the issue you are facing while rendering Gantt. As we are unable to replicate the issue, even when the start and end date of type string is used. 
It will be very helpful, if you modify the above sample to replicate the issue, to check from our end and provide you proper solution. 
 
 
Regards, 
Pooja K. 



SE Sean replied to Pooja Priya Krishna Moorthy April 15, 2021 04:19 PM UTC

Hi Samantha, 
We have prepared a sample and bound the data to Gantt in executeQuery. But we are unable to replicate the reported error. Please find the tested sample link. 
Please share us the details about the issue you are facing while rendering Gantt. As we are unable to replicate the issue, even when the start and end date of type string is used. 
It will be very helpful, if you modify the above sample to replicate the issue, to check from our end and provide you proper solution. 
 
 
Regards, 
Pooja K. 


Hi Pooja, 

We have been working with the SF Gantt control for months now and have huge amounts of code associated with it. 

We are unable to provide you with a reproducible example and we definitely can not send the source code to you either unfortunately.

Can we arrange for a short screen sharing session please ?

See below for issue:

1. We have data from the DataManager






2. this.$refs.gantt.ej2Instances.dataSource has data assigned



3. Nothing is rendered in the Gantt




4. No console errors



PP Pooja Priya Krishna Moorthy Syncfusion Team April 18, 2021 07:37 AM UTC

Hi Samantha, 
We have created a new incident under your account. Please use your direct trac account for further follow up.  

Regards, 
Pooja K. 


Loader.
Up arrow icon