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

Create an event by dragging from one date to another

4 Answers 125 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nithin
Top achievements
Rank 1
Nithin asked on 06 Apr 2018, 01:29 PM

I was somehow able to find support for creating a drag and create event from telerik itself. But the issue I found was that the scheduler didn't had grouping of resources so it worked fine.

Example from telerik

My application involves grouping of resources like rooms. Though it doesn't show any error while dragging and adding events, the events do not show up in the scheduler and after that if we click on other rooms for adding event my restriction starts to show "The Room Is Already Booked". 

My Example

Is there a way around it ?

 

Thanks 

4 Answers, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 10 Apr 2018, 09:23 AM
Hi Nithin,

As far as I can understand, you would like to drag-create events in a Scheduler with resources and grouping enabled. If this is the case, you will need to alter the suggested implementation so it passes the appropriate RoomID to the event that is being created. To do that you could use the slotByElement() and the resourcesBySlot() methods of the Scheduler:
if (selection.events && !selection.events.length) {
  var slot = scheduler.slotByElement($(e.target));
  var resource = scheduler.resourcesBySlot(slot);
  var roomId = resource.RoomID;
   
  //no events are selected then this is create
  scheduler.select(null);
  scheduler.addEvent({
    start: selection.start,
    end: selection.end,
    title: "No title",
    RoomID: roomId
  });
}

Here you will find a modified version of the sample sent.

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

Thanks a lot that helped :)

 

0
Nithin
Top achievements
Rank 1
answered on 25 Apr 2018, 11:01 AM
Hi Veselin,
Thanks for the help earlier regarding create event on drag.
I would also like to create an event on swipe in mobile devices. I did try to give the 

$("#touchSurface").kendoTouch({
     enableSwipe: true,
     touchstart: function(e) { kendoConsole.log("touch start"); },
     swipe: function(e) { kendoConsole.log("swipe " + e.direction); },
     tap: function(e) { kendoConsole.log("tap"); },
     doubletap: function(e) { kendoConsole.log("double tap"); },
     hold: function(e) { kendoConsole.log("hold"); }
 });

 

the above code inside databound but keep getting error
My Example

I do have right click, right click and drag and left click in this please suggest an alternative for all these events

Thanks

 

0
Veselin Tsvetanov
Telerik team
answered on 27 Apr 2018, 10:02 AM
Hi Nithin,

I am afraid, that implementing swipe-select and event create logic for the widget would require considerable refactoring of the widget logic and custom implementation for its scroll functionality. If you would like to get assisted in such task, I would recommend you our Professional services. That team is focused in implementing tailor-made solutions as per customer requirements. Please, let me know if you are interested in cooperating with our colleagues and I will arrange someone from the team to contact you directly.

Regards,
Veselin Tsvetanov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Nithin
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Nithin
Top achievements
Rank 1
Share this question
or