Resources Not Displayed on Task

Hi, I did same thing in the below but in my application, the resource name not showing. What is wrong with my code? The stackblitz URL is : Sample


Image_4101_1732262341506


2 Replies

EA Emrah Asma November 22, 2024 10:50 AM UTC

I think my resources have problem because it doesnt display resources on leftlabel too. but Taskname showing with rigthlabel. 

Image_4541_1732272403279

when I write this I found the problem below : ) 

Image_8878_1732272614409

I use resources not Resources, that is the problem for



AG Ajithkumar Gopalakrishnan Syncfusion Team November 25, 2024 11:19 AM UTC

Hi Emrah,

Greetings from Syncfusion Support,

We suspect that the shared code snippet is causing the issue. Based on our analysis, if resources are not explicitly passed and the dataSource is directly used with embedded resources, the reported case can be replicated. To resolve this, the resourceCollection must be explicitly passed to the Gantt chart. Below, we have attached the corrected code snippet and a sample for your reference.

// data collection

 

export let editingData = [

    {

       ...

        subtasks: [

            {

                TaskID: 2, TaskName: 'Identify site location', StartDate: new Date('04/02/2024'), Duration: 0,

                Progress: 30, Resources: [{ resourceId: 1, resourceName: 'Martin Tamer' }], info: 'Measure the total property area alloted for construction'

            },

            {

                TaskID: 3, TaskName: 'Perform Soil test', StartDate: new Date('04/02/2024'), Duration: 4, Predecessor: '2',

                Resources: [{ resourceId: 2, resourceName: 'Rose Fuller' }], info: 'Obtain an engineered soil test of lot where construction is planned.' +

                    'From an engineer or company specializing in soil testing'

            },

            { TaskID: 4, TaskName: 'Soil test approval', StartDate: new Date('04/02/2024'), Duration: 0, Predecessor: '3', Progress: 30 },

        ]

    },

    ...

];

// resource collection

export let editingResources = [

    { resourceId: 1, resourceName: 'Martin Tamer' },

    { resourceId: 2, resourceName: 'Rose Fuller' },
   …

];

<GanttComponent id='Editing' dataSource={editingData} taskFields={taskFields} resourceFields={resourceFields} resources={editingResources} >

         ...

</GanttComponent>

const taskFields = {

    ...

    resourceInfo: 'Resources'

};

const resourceFields = {

    id: 'resourceId',

    name: 'resourceName'

};


You can find a working example on StackBlitz.

For more information, you may refer to the following link:

Resources in React Gantt component | Syncfusion

If you have any further questions or need additional assistance, please let me know!

Regards,
Ajithkumar G


Loader.
Up arrow icon