Gantt chart > Resources : selected resources not showing on add or edit dialog box.

Hi

I am using ejs-gantt chart in asp.net core. How can i show selected resources inside  resource tab.please resolve this issue as soon as possible.

Issue

1. How to get selected resources without use viewbag.

2. I can use (e-data-manager) is not showing selected resources data. 
     
     Get task data with selected resources data using e-data-manager. 

  <e-data-manager url="/Project/[email protected]" adaptor="UrlAdaptor" batchUrl="/Project/SaveGanttData?            [email protected]"></e-data-manager>



Attachment: sample_request_5a3c65e9.zip

1 Reply 1 reply marked as answer

MS Monisha Sivanthilingam Syncfusion Team June 11, 2021 10:43 AM UTC

Hi Himmat, 
 
Greetings from Syncfusion support. 
 
Please find the response for your queries below. 
 
Sl.No. 
Query 
Syncfusion Comments 
 
1 
How to get selected resources without use viewbag. 
We can use the load event to assign the resource data in the Gantt Chart. The following code snippets demonstrate the solution. 
 
Index.cshtml 
 
<script> 
function load() { 
let resourceCollection = [ 
  { resourceId: 1, resourceName: "Martin Tamer" }, 
  { resourceId: 2, resourceName: "Rose Fuller" }, 
  { resourceId: 3, resourceName: "Margaret Buchanan" }, 
  { resourceId: 4, resourceName: "Fuller King" }, 
  { resourceId: 5, resourceName: "Davolio Fuller" }, 
  { resourceId: 6, resourceName: "Van Jack" }, 
  { resourceId: 7, resourceName: "Fuller Buchanan" }, 
  { resourceId: 8, resourceName: "Jack Davolio" }, 
  { resourceId: 9, resourceName: "Tamer Vinet" }, 
  { resourceId: 10, resourceName: "Vinet Fuller" }, 
  { resourceId: 11, resourceName: "Bergs Anton" }, 
  { resourceId: 12, resourceName: "Construction Supervisor" } 
]; 
var ganttObj=document.getElementById("RemoteData").ej2_instances[0]; 
ganttObj.resources = resourceCollection; 
} 
</script> 
 
 
 
2 
I can use (e-data-manager) is not showing selected resources data. 
This issue occurs only if there is a difference in mapping the resource field between the data and the taskfields mapping. Please ensure that the mapping of the resources matches in the following cases. 
 
Index.cshtml 
 
<e-gantt-taskfields id="taskId" name="taskName" startDate="startDate" 
            duration="duration" progress="progress" dependency="predecessor" 
            parentID="parentID" resourceInfo="resources"> 
    </e-gantt-taskfields> 
 
 
HomeController.cs 
 
new GanttDataSource(){ 
   taskId = 1, 
   taskName = "Project initiation", 
   startDate = new DateTime(2019, 03, 29), 
   endDate = new DateTime(2019, 04, 21), 
   resources = new List<ResourceModel> 
   { 
     new ResourceModel { ResourceId = 1, ResourceUnit = 70, ActivityId=40 }, 
     new ResourceModel { ResourceId = 6 , ActivityId=40} 
   } 
}, 
 
 
 
 
We have also prepared a sample for your reference.                                                 
 
Please contact us if you require any further assistance. 
 
Regards, 
Monisha. 


Marked as answer
Loader.
Up arrow icon