Solved: FullCalendar Drag and drop

Answered
0
0

Hi,

i try to make a drag and drop functionality with a fullcalendar control. I use a label that i drop on the calendar control. On the DragDrop event i get the location and it’s correct.

My question is :is it a simple way to get the timeslot corresponding to the location where the item have been dropped? If not is it possible to plan this feature in the newt weeks/month ?

Best regards,

Stéphane

  • You must to post comments
Great Answer
1
0

Hi Stephane,

For the ContextMenu you asked, you can always use the EventClick event. If Button = Right, you can create a ContextMenu and show it there. You can have different ContextMenus depending on the event that was clicked. For example:

private void Calendar_EventClick(object sender, EventClickEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
var myMenu = new ContextMenu(); // or put your custom-designed ContextMenu
myMenu.MenuItems[“EDIT”].Enabled = e.Event.Editable;
myMenu.MenuItems[“COPY”].Visible = e.Event.Start < DateTime.Now;
if (e.Event.UserData.IsPending)
{
myMenu.MenuItems.Add(“Reschedule”);
}

myMenu.Show(e.Location);
}
}

Best,
Alex

  • henry stephane
    thanks a lot! you give the right direction. just a little think : there’s probably a little bug with the location info on the right clic on event. with this code: private void Calendar_EventClick(object sender, Wisej.Web.Ext.FullCalendar.EventClickEventArgs e) { contextMenu1.Show(e.Location); } private void Calendar_DayClick(object sender, Wisej.Web.Ext.FullCalendar.DayClickEventArgs e) {contextMenu1.Show(e.Location);} the right clic on event show the menu centered like on a left clic. i’ve tried to force the position with codes like: private void Calendar_EventClick(object sender, Wisej.Web.Ext.FullCalendar.EventClickEventArgs e) { if (e.Button == Wisej.Web.MouseButtons.Right) contextMenu1.Show(Calendar, e.Location, LeftRightAlignment.Right); else contextMenu1.Show(e.Location); } but after the right clic on an event, it seems that the location returned by all the future event are wrong. it’s not a main issue but it’s maybe easy to fix best regards stéphane
  • You must to post comments
0
0

hi,

here the samples on which i’m working. the dayclic is fine but i would like to use some context menu on the right clic on the calendar or on a specific event.

For the drag and drop i use an external label which symbolize a preformed event : something looking like the https://fullcalendar.io/js/fullcalendar-3.2.0/demos/external-dragging.html

i also find usefull if you can add the scheduler (https://fullcalendar.io/scheduler/) (maybe is it all-ready done but i didn’t find it)

i’m sorry if my post looks like a Christmas wish 🙂

best regards

Stéphane

  • Luca (ITG)
    Thanks. We’ll add a new event FullCalendar.ItemDrop with the DayClickEventArgs which contains the timeslot info. The schedule addition to the fullcalendar is a paid addition to the fullcalendar component that you need to license directly. It’s enough to add the view to the FullCalendar extension (the source code in the extensions page) and license the addition. It works the same as the full calendar without the scheduler.
  • henry stephane
    it’s a very good news. i’ll be happy to get the updated event :-)
  • henry stephane
    Hello. Do you know when you will probably add the new event with timeslot info ? in the next month would be perfect for me, but if no i have to know to find solutions for my project. Thank’s a lot for your help. Stéphane
  • You must to post comments
0
0

With the fullcalendar you can drag & drop & extend existing event objects. When the event is dragged (or extended) you get the EventChanged event. You can also click anywhere on the calendar and get the DateTime of the click location in the DayClick event.

We can add the date/time information to some mouse events coming in from the fullcalendar widget. How do you drop the external label? Do you set the Draggable property to true? Or do you use DoDragDrop()?

Can you send a small test case?

  • You must to post comments
1
0

hi,

in a more general way it seems note possible to get the time slot of mouse event, am i right?

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.