In Add/Edit Task dialog, hide the id of the resource

Hi,

Would it be possible to hide the ID column programmatically in the add/edit dialog of the Gantt component?


Thank you in advance.

Best Reg

Matteo


3 Replies 1 reply marked as answer

GM Gopinath Munusamy Syncfusion Team February 24, 2023 06:59 AM UTC

Hi Matteomessmer,



To Hide ResourceId column from Add and edit dialog, you can use the actionBegin event with a requestType of beforeOpenEditDialog or beforeOpenAddDialog. Inside this event, we need to set the visible property of the ResourceId column as false. For your reference, a sample and code snippets are attached. Check the sample and documentation links below for more details.


Code Snippets:

[App.tsx]

 

const actionBegin = (args: any) => {

    if (args.requestType == 'beforeOpenEditDialog' || args.requestType == 'beforeOpenAddDialog') {

      args.Resources.columns[1].visible = false;

    }

  };

//…

<GanttComponent ref={(gantt) => (ganttInst = gantt)}

        actionBegin={actionBegin}>

 



Sample: https://stackblitz.com/edit/react-ts-8dbdpq?file=data.js,App.tsx

UG Documentation: https://ej2.syncfusion.com/react/documentation/api/gantt#actionbegin



Regards,

Gopinath M


Marked as answer

MA matteomessmer February 24, 2023 08:20 AM UTC

It works

Thank you!



GM Gopinath Munusamy Syncfusion Team February 27, 2023 12:16 PM UTC

Matteo, you’re most welcome. Please get back to us if you require any further assistance.


Loader.
Up arrow icon