maddhatter / laravel-fullcalendar

Laravel FullCalendar.io Helper
627 stars 267 forks source link

Using Bootstrap Popover with eventMouseover #101

Open blackjarnold opened 6 years ago

blackjarnold commented 6 years ago

Hello!

Thanks maddhatter for this awesome package!

So I want to use Bootstrap's Popover method with FullCalendar. I want to do like this: screen shot 2018-01-31 at 12 46 09

So far I have this in my EventsController: screen shot 2018-01-31 at 12 44 35

As it is not possible to use load bootstrap in the controller, how should I do this? Is it possible to call a function from the view?

I am quite new to Laravel, so any help would be appreciated!

Thanks!

guillermobt commented 6 years ago

Use the callback 'eventRender'. Something like this:

'eventRender' => 'function eventRender(event,element,view) {
  element.popover({ ...
blackjarnold commented 6 years ago

I'll give that a try. Thank you!

blackjarnold commented 6 years ago

Do I put it inside the eventMouseover callback? Another issue is that I can't put html inside the eventRender because of the quotations. :/

powolnymarcel commented 6 years ago

guillermobt your method is not working, any help on the topic ?

Iperia17 commented 6 years ago

Hello, I have the same problem since several days a "tooltip" or a "mouseover" are impossible ... Nothing on Web I despair ... help me

nickpoulos commented 6 years ago

Yep I tried this exact same method before I found this. Anytime you set eventRender at all it bombs. I tried putting the function directly in the string like above, also tried calling a pre-made javascript function called popit. Both failed with the same error:

$calendar = Calendar::addEvents($events) ->setOptions([ 'eventRender' => "popit" ]);

app.js:77086 Uncaught TypeError: optHandler.apply is not a function at Calendar.publiclyTrigger (app.js:77086) at MonthView.DateComponent.publiclyTrigger (app.js:76514) at DayGridEventRenderer.EventRenderer.filterEventRenderEl (app.js:72138) at HTMLAnchorElement. (app.js:72098) at Function.each (app.js:5302) at jQuery.fn.init.each (app.js:5137) at DayGridEventRenderer.EventRenderer.renderFgSegEls (app.js:72094) at DayGridEventRenderer.EventRenderer.renderFgRanges (app.js:72018) at DayGridEventRenderer.EventRenderer.render (app.js:72007) at SubClass.DateComponent.executeEventRender (app.js:76581)

simeonbugarija commented 5 years ago

Here is an example for bootstrap tooltip

$calendar = Calendar::addEvents($events)->setOptions(['firstDay' => 1])->setCallbacks(['eventRender' => 'function (event,jqEvent,view) {jqEvent.tooltip({placement: "top", title: event.title});}']);

Also , I added some css because the tooltip was not fully visible:

.tooltip { position: fixed; }