We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

disable drag event???

If I drag the scheduler, the date is changed. but I don't want this function,

how i disable date change event???

5 Replies

VS Velmurugan S Syncfusion Team February 11, 2015 11:15 AM UTC

Hi Jeong,

Thanks for using Syncfusion products.

Your requirement on “disable the drag” can be achieved within our Schedule control in two ways as follows:

1. Disable the Drag and Drop for all the appointments.

If Drag and Drop should be disabled for all the appointments within the Schedule control, you need to disable the property value “allowDragDrop”. Please find the following code snippet to “disable the allowDragDrop”.

<code>

                $(function () {

            var dManager = ej.DataManager(window.Default).executeLocal(ej.Query().take(10));

            $("#Schedule1").ejSchedule({

                width: "100%",

                height: "525px",

               allowDragDrop:false,

            });

        });

</code>

2. Disable the Drag and Drop for particular appointment.

Disabling the drag and drop for particular appointment or any particular scenario can be achieved with our Schedule control “actionComplete” event. We suggest you to set “args.cancel” value as “true” within the defined “ondragStop” method as shown in the following code snippet.

<code>

<script type="text/javascript">

        $(function () {

            var dManager = ej.DataManager(window.Default).executeLocal(ej.Query().take(10));

            $("#Schedule1").ejSchedule({

                width: "100%",

                height: "525px",

                dragStop: "onDragStop",

               appointmentSettings: {

                    dataSource: dManager,

                    id: "Id",

                    subject: "Subject",

                    startTime: "StartTime",

                    endTime: "EndTime",

                    description:"Description",

                    allDay: "AllDay",

                    recurrence: "Recurrence",

                    recurrenceRule: "RecurrenceRule"

                }

            });

        });

             

        function onDragStop(args) {

            args.cancel = true;  // Need to set the value as true

        }

    </script>

And also for your reference we have prepare a sample with the above code snippets, which can be download from the following location.

http://www.syncfusion.com/downloads/support/directtrac/118201/SchedulePreventDragDrop83609682.zip

Please let us know if it helps and if you need any further assistance on this.

Regards,

Velmurugan


JS Jeong Sik Yoo February 12, 2015 06:50 AM UTC

Thanks for your answer but It is not that I intend.

The date is not changed when I drag from the ejScheduler. not appointment!

how i do??

Attachment: scheduler_problem_5e8cd804.zip


VS Velmurugan S Syncfusion Team February 13, 2015 06:02 AM UTC

Hi Jeong,

Thanks for your update.

We have prepared the sample to meet your requirement “While dragging Date should not change”, which can be downloaded from the following location.

http://www.syncfusion.com/downloads/support/directtrac/117454/SchedulePreventDateChange1993501161.zip

And we have used the following code snippet in the above sample to meet the requirement.

<code>

<script>

function drawExption() {

    var dManager = ej.DataManager(window.Default).executeLocal(ej.Query().take(10))

    $("#Schedule_exeption").ejSchedule({

        dateFormat: "yyyy-MM-dd",

        enableAppointmentNavigation: false,

        ------------------------------

        ------------------------------

    });

    var schObj = $("#Schedule_exeption").data("ejSchedule");

    schObj._off(schObj.element, "swipeleft swiperight", ".e-contentarearow .e-workcellstab");

}

function drawWeek() {

var dManager = ej.DataManager(window.Default).executeLocal(ej.Query().take(10))

    $("#Schedule_weekly").ejSchedule({

        dateFormat: "yyyy-MM-dd",

        enableAppointmentNavigation: false,

        width: "100%",

        height: "525px",

        -------------------------------

        -------------------------------

    });

    var schObj = $("#Schedule_weekly").data("ejSchedule");

    schObj._off(schObj.element, "swipeleft swiperight", ".e-contentarearow .e-workcellstab");

}

    </script>

</code>

Please let us know if it helps and if you need any further assistance on this.

Regards,

Velmurugan


JS Jeong Sik Yoo February 13, 2015 07:07 AM UTC

oh!!!!
right!!
Awesome!!!

Thanks!!



VS Velmurugan S Syncfusion Team February 16, 2015 04:25 AM UTC

Hi Jeong,

Thanks for your valuable feedback.

Please let us know if you need any further assistance on our products.

Regards,

Velmurugan



Loader.
Live Chat Icon For mobile
Up arrow icon