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

Thread is closed for posting
4 posts, 0 answers
  1. Tomas
    Tomas avatar
    3 posts
    Member since:
    Nov 2012

    Posted 24 Apr 2014 Link to this post

    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.
  2. Rosen
    Admin
    Rosen avatar
    3253 posts

    Posted 25 Apr 2014 Link to this post

    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!
     
  3. Roy
    Roy avatar
    30 posts
    Member since:
    Oct 2007

    Posted 21 Jul 2014 in reply to Rosen Link to this post

    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"
                }
            }
        });

  4. Rosen
    Admin
    Rosen avatar
    3253 posts

    Posted 22 Jul 2014 Link to this post

    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!
     
Back to Top