This is a migrated thread and some comments may be shown as answers.

Disable scheduler double click edit window without to disable drag-and-drop

3 Answers 921 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Annette
Top achievements
Rank 2
Annette asked on 24 Apr 2014, 11:46 AM
I am using the MVC wrapper of Kendo. I have scheduler with draggable and resizable tasks. However, when I double click a task I see this message "Do you want to edit only this event occurrence or the whole series?”. I tried to disable it using Kendo's client events but without any success.

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 25 Apr 2014, 07:07 AM
Hi Tomas,

In order to disable the event editing functionality you will need to set Editable's Update setting to false:

@(Html.Kendo().Scheduler<ViewModel>()
    .Name("scheduler"
    /*..*/
    .Editable(editable => editable.Update(false)
             /*.Create(true) //optionally disable creating new events*/
     )
)


Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Roy
Top achievements
Rank 1
answered on 21 Jul 2014, 08:32 PM
ok this is kind of what i am looking for.

Currently I have a context menu that appears when I wright click an event that lets me pick different things I need to do for each event. I have a custom editor template and that works great when I double click, for editing and for adding a new event. I want to be able to load the edit/create popup from the context menu, and stop being able to edit/create from the double click.

The context menu i am using is from here http://medialize.github.io/jQuery-contextMenu/index.html
and the source is located at https://github.com/medialize/jQuery-contextMenu


here is the  javascript code I am using for doing the context menu in my page. I figure I will have to have a different contect menu for the edit since this one is looking for .k-event class, but i included it here right now. I just need to know how to get the create popup to occur from the context menu.

    $.contextMenu({
        selector: '.k-event',
        trigger: 'left',
        callback: function (key, options) {
            var scheduler = $("#scheduler").data("kendoScheduler");
            var dataSource = scheduler.dataSource;
            var uid = $(this).attr("data-uid");
            //scheduler.editEvent(dataItem);
            var dataItem = dataSource.getByUid(uid);
            var completed = dataItem.AppointmentCompleted;

            if (key == "completed") {

                if (completed != true){
                    MarkAppointmentComplete(dataItem, uid);
                }
                else {
                    AppointmentAlreadyCompelted("Warning", "alreadycompleted-confirmation");
                }
            } else if (key == "usedresources") {
                LoadAppointmentCompletedDialog("/Appointment/MarkAppointmentCompleted", 800, 900, dataItem.AppointmentId, dataItem.AppointmentCompletedId);
                //    var dataItem = dataSource.getByUid(uid);
                //    scheduler.removeEvent(dataItem);

            } else if (key == "invoice") {
                MarkAppointmentReadyToInvoice(dataItem, uid);
            } else if (key == "Edit") {
                alert("Edit functionality to come");
            }
        },
        items: {
            "completed": {
                name: "Appointment Completed",
                icon: "greencheck",
                disabled: function(key, opt) {
                    // this references the trigger element
                    var scheduler = $("#scheduler").data("kendoScheduler");
                    var dataSource = scheduler.dataSource;
                    var uid = $(this).attr("data-uid");
                    //scheduler.editEvent(dataItem);
                    var dataItem = dataSource.getByUid(uid);
                    var completed = dataItem.AppointmentCompleted;
                    if (completed == true) return !this.data('completed');
                    return this.data('completed');
                }
            },
            "usedresources": {
                name: "Used Inventory",
                icon: "table",
                disabled: function(key, opt) {
                    // this references the trigger element
                    var scheduler = $("#scheduler").data("kendoScheduler");
                    var dataSource = scheduler.dataSource;
                    var uid = $(this).attr("data-uid");
                    //scheduler.editEvent(dataItem);
                    var dataItem = dataSource.getByUid(uid);
                    var isreadytoinvoice = dataItem.IsReadyForInvoicing;
                    if (isreadytoinvoice == true) return !this.data('usedresources');
                    return this.data('usedresources');
                }
            }
            ,
            "invoice": {
                name: "Mark for Invoicing",
                icon: "edit",
                disabled: function(key, opt) {
                    // this references the trigger element
                    var scheduler = $("#scheduler").data("kendoScheduler");
                    var dataSource = scheduler.dataSource;
                    var uid = $(this).attr("data-uid");
                    //scheduler.editEvent(dataItem);
                    var dataItem = dataSource.getByUid(uid);
                    var isreadytoinvoice = dataItem.IsReadyForInvoicing;
                    var completed = dataItem.IsCompleted;
                    if (isreadytoinvoice == true) return !this.data('invoice');
                    return this.data('invoice');
                }
            },
            "edit": {
                name: "Edit or Create Appointment",
                icon: "plus"
            }
        }
    });

0
Rosen
Telerik team
answered on 22 Jul 2014, 10:47 AM
Hi Roy,

In order to show the edit form for already existing item you will need to use the Scheduler widget editEvent method. The addEvent method should be use when adding new event.

If you continue experiencing difficulties, please open a separate support request (as this thread has diverge from its original topic) in which provide a small sample which demonstrates your scenario and the exact issue you are facing.

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Scheduler
Asked by
Annette
Top achievements
Rank 2
Answers by
Rosen
Telerik team
Roy
Top achievements
Rank 1
Share this question
or