Recommeded way to disable a button in segment tab container

There is an add button at the top right corner of the segment tab container of the add/edit dialog. The element has this id: Gantt Chart ID + SegmentTabContainer_add. If can disable the add button if I add this in the browser:

.e-overlay { pointer-events: none;}

But how to programatically disable the add button, while still can split task through the context menu? My code apparently cannot work, coz the gantt segment tab container element is not there when the general tab is active.

    public async void GanttDialogOpenedHandler(GanttDialogOpenedEventArgs<TaskInfoModel> args)
    {
        await JSRuntime.InvokeVoidAsync("eval", $@"window.document.getElementById(""GanttSegmentTabContainer_add"")
.classList.add(""e-overlay"");");
    }

1 Reply 1 reply marked as answer

VN Vignesh Natarajan Syncfusion Team September 16, 2024 10:34 AM UTC

Hi Desmond,

Greetings from Syncfusion Support,

Currently, we do not have support to customize the dialog box in our Gantt Chart. We have already logged this requirement “Need to provide support for customize dialog edit box” as uncertain feature at our end.

We will plan to implement this feature in any of our upcoming release. You can now track the current status of request, review the proposed resolution timeline, and contact us for any further inquiries through the below feedback link,

Feedback link: https://www.syncfusion.com/feedback/46028/need-to-provide-support-for-customize-dialog-edit-box

Additionally, to workaround this, we have implemented a custom CSS property to hide the add button. We have attached the code snippet and sample for reference:

//razor page
<SfGantt @ref="obj">

</SfGantt>

<
style>

    #GanttSegmentTabContainer_add button {

        display:none;

    }

</style>


Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Index2052776075.zip



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

Regards,
Ajithkumar G


Marked as answer
Loader.
Up arrow icon