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.
Unfortunately, activation email could not send to your email. Please try again.

disable drag event???

Thread ID:

Created:

Updated:

Platform:

Replies:

118201 Feb 10,2015 09:36 PM Feb 15,2015 11:25 PM JavaScript 5
loading
Tags: ejSchedule
Jeong Sik Yoo
Asked On February 10, 2015 09:36 PM

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

how i disable date change event???

Velmurugan S [Syncfusion]
Replied On February 11, 2015 06:15 AM

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

Jeong Sik Yoo
Replied On February 12, 2015 01:50 AM

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

Velmurugan S [Syncfusion]
Replied On February 13, 2015 01:02 AM

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

Jeong Sik Yoo
Replied On February 13, 2015 02:07 AM

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

Thanks!!


Velmurugan S [Syncfusion]
Replied On February 15, 2015 11:25 PM

Hi Jeong,

Thanks for your valuable feedback.

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

Regards,

Velmurugan



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;