Is there a way to disable a specific event in the kendo ui scheduler?

I work with the Kendo user interface, js and the scheduler component.

My question is is there a way to disable a specific event from the scheduler.

I find this one , but it disables all events in the scheduler. I want to disable only a specific event. The code should look something like this:

function disableEvents()
{
    var data = $("#scheduler").data("kendoScheduler").dataSource.data();
    data.forEach(function(event){
          if(event.ID='2') 
          {
               event.disable = true; //I have tried with event.editable = true;
          }
    });
}

I cannot find a property, editable or disabled, or something like that. Perhaps there is a way to disable it using jquery. Can anybody help me?

Thank!

+2
source share
2 answers

preventDefault:

$("#scheduler").kendoScheduler({
    date: new Date("2013/6/6"),
    views: ["day", "month"],
    dataSource: [{
        id: 1,
        start: new Date("2013/6/6 08:00 AM"),
        end: new Date("2013/6/6 09:00 AM"),
        title: "Interview editable"
    }, {
        id: 2,
        start: new Date("2013/6/6 06:00 AM"),
        end: new Date("2013/6/6 07:00 AM"),
        title: "Interview not editable"
    }],
    edit: function (e) {
        if (e.event.id === 2) {
            e.preventDefault();
        }
    }
});

()

+2

, Kendo preventDefault, .

: Kendo.

(.. , , , ), . :

    resize: function(e) {
        if (e.event.meetingID = 1) {
            this.wrapper.find(".k-marquee-color").addClass("invalid-slot");
            e.preventDefault();
        }
    },
    move: function(e) {
        if (e.event.meetingId = 1) {
            this.wrapper.find(".k-event-drag-hint").addClass("invalid-slot");
        }
    },
    save: function(e) {
        if (e.event.meetinID = 1) {
            e.preventDefault();
        }
    },
   edit: function (e) {
        if (e.event.meetinID = 1) {
            e.preventDefault();
        }
    }

Kendo :

+2

Source: https://habr.com/ru/post/1537217/


All Articles