dialogmodal-dialogdragsyncfusion

how to drag only header in syncfusion scheduler dialog


net core C# syncfusion scheduler.

I made my scheduler's dialog draggable

        function OnPopupOpen(args) {

        var dragElement = document.getElementById('schedule_dialog_wrapper');
        var draggable = new ej.base.Draggable(dragElement, { clone: false });

but I want make drag only I drag the header but my dialog is draggable anywhere... like this...

https://drive.google.com/file/d/1obbc0ti8TgWrG6U8A9igqLtxE0fIKMor/view?usp=sharing


Solution

  • You can make drag only when drag the header of dialog instead of full dialog by using the Dialog’s allowDragging property in the Schedule’s popupOpen event, as shown in the below shared snippet.

    allowDragging UG: https://ej2.syncfusion.com/aspnetcore/documentation/dialog/getting-started#draggable

    Demo: https://ej2.syncfusion.com/aspnetcore/Dialog/Draggable#/fluent

    function onPopupOpen(args) 
    {
        var dialogInstance = document.querySelector(".e-dialog").ej2_instances[0];
        dialogInstance. allowDragging = true;
    }