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

Cutomize k-event-drag-hint when moving

3 Answers 203 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 10 May 2017, 06:48 AM

Hi,

I'm trying to change the background of the "k-event-drag-hint" div when the user is moving an event on top of another.

 

function onEventMoved(e) {
    if (roomIsOccupied(e.start, e.end, e.event, e.resources)) {
        $(".k-event-drag-hint").find('div').css('background', 'blue');
        e.preventDefault();
        return;
    }
    $(".k-event-drag-hint").find('div').css('background', 'red');
}

 

When I randomly move an event I can see the green background BUT when roomIsOccupied returns true, my code seems to have no effect (background is not red).

>> If i remove the e.preventDefault() then the background turns to blue. 

 

Any idea on how i can fix this issue? 

 

Thx

Seb

3 Answers, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 11 May 2017, 07:52 AM
Hello Seb,

I have already answered to your question in the Support ticket thread, that you have opened on the same topic. In case you have any further questions, I would suggest you to continue the discussion there.

Regards,
Veselin Tsvetanov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Dov
Top achievements
Rank 1
answered on 04 Sep 2018, 09:25 AM

Hi,

Is it possible to see the answer ?

thanks

0
Veselin Tsvetanov
Telerik team
answered on 04 Sep 2018, 11:44 AM
Hello Dov,

Here is the answer to the Jason's question:

In order to achieve the desired I have modified the move event handler in the following way:
move: function(e) {
    if (roomIsOccupied(e.start, e.end, e.event, e.resources)) {
        $(".k-event-drag-hint").find('div').css('background', 'blue');
        //e.preventDefault();
        return;
    }
 
 $(".k-event-drag-hint").find('div').css('background', 'red');
},

As you will notice, I have commented out the e.preventDefault() , which is not needed. The reason is that the move event will not perform any action on the event data itself, so there is actually nothing to be prevented.

Here you will find a Dojo sample implementing the above.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Scheduler
Asked by
Jason
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Dov
Top achievements
Rank 1
Share this question
or