Trigger Event Creation on regular button

137 views
Skip to first unread message

my.ki...@gmail.com

unread,
Oct 6, 2017, 9:14:00 AM10/6/17
to jquery week calendar
Hi everyone,
our client has a with creating multiple events on the same date on mobile version.
We have full day events and it's still possible to create another events this day. But in this case we cant create other event because we have no space to click to create new event next to existing one.
My first solution was to create a small gutter on the right. It works well but the gap is too small for mobile device, and If I make it bigger it looks like crap.
The main idea of our client is to create button in each day slot, right under the date label. and by clicking it we should open the popup. The default selected dates should be min and max.
I believe the whole magi happens in "_setupEventCreationForWeekDay" method, especially in this part:
}).mouseup(function(event) {
var $target = $(event.target);

var $weekDay = $target.closest('.wc-day-column-inner');
var $newEvent = $weekDay.find('.wc-new-cal-event-creating');

if ($newEvent.length) {
var createdFromSingleClick = !$newEvent.hasClass('ui-resizable-resizing');

//if even created from a single click only, default height
if (createdFromSingleClick) {
$newEvent.css({height: options.timeslotHeight * options.defaultEventLength}).show();
}
var top = parseInt($newEvent.css('top'));
var eventDuration = self._getEventDurationFromPositionedEventElement($weekDay, $newEvent, top);

$newEvent.remove();
var newCalEvent = {start: eventDuration.start, end: eventDuration.end, title: options.newEventText};
var showAsSeparatedUser = options.showAsSeparateUsers && options.users && options.users.length;

if (showAsSeparatedUser) {
newCalEvent = self._setEventUserId(newCalEvent, $weekDay.data('wcUserId'));
}
else if (!options.showAsSeparateUsers && options.users && options.users.length == 1) {
newCalEvent = self._setEventUserId(newCalEvent, self._getUserIdFromIndex(0));
}

var freeBusyManager = self.getFreeBusyManagerForEvent(newCalEvent);

var $renderedCalEvent = self._renderEvent(newCalEvent, $weekDay);

if (!options.allowCalEventOverlap) {
self._adjustForEventCollisions($weekDay, $renderedCalEvent, newCalEvent, newCalEvent);
self._positionEvent($weekDay, $renderedCalEvent);
} else {
self._adjustOverlappingEvents($weekDay);
}

var proceed = self._trigger('beforeEventNew', event, {
'calEvent': newCalEvent,
'createdFromSingleClick': createdFromSingleClick,
'calendar': self.element
});
if (proceed) {
options.eventNew(newCalEvent, $renderedCalEvent, freeBusyManager, self.element, event);
}
else {
$($renderedCalEvent).remove();
}
}
});

Unfortunately I've found no solution in the whole thread.

MEDDEB Bassem

unread,
Oct 6, 2017, 12:16:52 PM10/6/17
to jquery-wee...@googlegroups.com

hi,

 

I use this method for mobile, 

 

eventRender : function(calEvent, $event) {

  

         $event.css("width" , "95% !important");

 

}

 

it gives me a space at the end to add another space for the click

 

Images intégrées 1




Cordialement,
Bassem MEDDEB
+216 20 244 670

--
You received this message because you are subscribed to the Google Groups "jquery week calendar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jquery-week-calendar+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

my.ki...@gmail.com

unread,
Oct 10, 2017, 2:16:51 AM10/10/17
to jquery week calendar
 Hi there,
Thanks for your reply.
But the problem is that I was using the same solution and it was fine-n-dandy.
But the one of our clients who's using calendar asked to made modifications.
U see, he want's to have 3 days displayed on mobile. An din this case this gutter is just too small (especially when we have 2-3 events on the same day and same time).

Reply all
Reply to author
Forward
0 new messages