ui-calendar icon indicating copy to clipboard operation
ui-calendar copied to clipboard

Select method does not work with single click in UI-Calendar.

Open sharankasandula opened this issue 8 years ago • 4 comments

So I have spent quite a lot of time getting this thing to work.

The ui-calendar repo does not have "select" mothod. i.e, to make a selection to create an event, according to the Full calendar documentation - select (method)

As of now the selection functionality works, except that the event is not created with a single click. Its created only when the user clicks and drags. Did anyone else have this problem as well? I don't have dayClick() function in case you are wondering.

Here's my select() function.

function select (start,end,jsEvent,view){ startTime = start; $scope.endTime = end; $scope.events.push({ start: $scope.startTime, end: $scope.endTime, className: ['Booking'], overlap: false, allDay : false, 'timeDifference' : timeDiff, 'eventPrice' : eventPrice }); }

Also, the selectMinDistance doesn't seem to work. Can someone help me with this? Thanks

sharankasandula avatar Apr 27 '17 10:04 sharankasandula

I have the same problem...Have you solved the problem yet?

Elemy avatar Aug 22 '17 06:08 Elemy

thanks a lot! I got a solution yet~

Elemy avatar Aug 23 '17 08:08 Elemy

Can you share the solution here in this thread so that it helps others as well. Also, I am curious as to how I you did it.

sharankasandula avatar Aug 23 '17 08:08 sharankasandula

you need to create function for select before init the calendar config. Example :

$scope.select = function (start, end, allDay){
		console.log('Select ' + start, end);
	}

/* config object */
    $scope.uiConfig = {
      calendar:{
    	  header: {
				left: '',
				center: '',
				right: ''
			},
		eventClick: $scope.alertOnEventClick,
	        eventDrop: $scope.alertOnDrop,
	        eventResize: $scope.alertOnResize,
	        eventRender: $scope.eventRender,
	        selectable: true,
	        selectHelper: true,
	        select: $scope.select,
		firstDay:0,
		defaultView: 'agendaWeek',
		columnFormat: 'dddd',
		editable: false,
		allDaySlot:false,
		events: []
      }
    };

sh4mz avatar Sep 29 '17 03:09 sh4mz