Gantt chart Resources : Not showing selected resources

Hi

I am using ejs gantt chart in asp.net core. 

1. I can assign resources to task using the Add/Edit dialog box's resources tab

I user data manager to fetch task data from my controller method as shown below

url="/Project/[email protected]" adaptor="UrlAdaptor" batchUrl="/Project/[email protected]">

get task data with resources in actionBegin function.



-----

2. I want to hide the Id field from resource tab view however this guid will be used for selection purpose

3. When I change selection of resources, I don't get selected resources information in SaveData call assigned to batchurl attribute.

I would appreciate if you can provide small working code of how to save and retrieve the custom resources (using GUId as ID) using datamanger.





Attachment: Gantt_Resources_ad629d06.zip

1 Reply 1 reply marked as answer

MS Monisha Sivanthilingam Syncfusion Team June 9, 2021 09:38 AM UTC

Hi Himmat, 
 
Greetings from Syncfusion support. 
 
Please find the response for your queries below. 
 
Sl.No. 
Query 
Syncfusion Comments 
 
1 
I want to hide the Id field from resource tab view however this guid will be used for selection purpose 
We would like to inform that currently, Gantt Chart does not support alphanumeric strings as either TaskId or ResourceId. Hence, it is not possible to use GUID instead of ResourceId. However, we have already logged a feature report for it. You can track its status from the below feedback link. 
 
 
As we have already lined up some major features, we could not implement this support immediately. We will implement this and include it in any of our upcoming releases. Please cast your vote on this feature. Based on the customer demand we will prioritize the features in our upcoming road map. 
 
However, you can hide the ResourceId field using the beforeOpenAddDialog and beforeOpenEditDialog requestTypes in the actionBegin event. The following code snippets demonstrate the solution. 
 
Index.cshtml 
function actionBegin(args) { 
        if (args.requestType == "beforeOpenAddDialog" || args.requestType == "beforeOpenEditDialog") { 
            args.Resources.columns[1].visible = false;  
            args.Resources.columns.push("GUID"); 
        } 
} 
 
 
2 
When I change selection of resources, I don't get selected resources information in SaveData call assigned to batchurl attribute. 
We are able to get the changed selection of resources in our events. We have made use of the beforeAdd and beforeSave requestType in the actionBegin event to get the GUID of the selected resources. The following code snippets demonstrate the solution. 
 
Index.cshtml 
 
function actionBegin(args) { 
        var guid = []; 
        if (args.requestType == "beforeSave" || args.requestType == "beforeAdd") { 
            for (var i = 0; i < args.data.ganttProperties.resourceInfo.length; i++) { 
                guid.push(args.data.ganttProperties.resourceInfo[i].GUID); 
            } 
            console.log(guid); 
        } 
    } 
 
 
 
 
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