philippfrenzel / yii2fullcalendar

JQuery Fullcalendar Yii2 Extension
GNU General Public License v2.0
132 stars 95 forks source link

$description is deprecated, how to show tool-tip on hover event? #132

Closed Legion112 closed 5 years ago

Legion112 commented 5 years ago

I understand I need to user nonstandard fields instead but I can't understand how to implement it.

Could you please show a simple tooltip.

        $event = new Event([
            'nonstandard' => [
           // how to show tool-tip?
            ],
        ]);
Legion112 commented 5 years ago

I have found solution

new Event([
            'start' => $plan->date_execution,
            'title' => $plan->description,
            'color' => $plan->isPayment ? 'green' : '#01c0ef',
            'nonstandard' => [
                'description' => "$model->typeText № $model->number от $contractDate {$model->contractor->title}",
            ],
            'url' => Url::to(['fact', 'id' => $model->id]),
        ]);
echo \yii2fullcalendar\yii2fullcalendar::widget([
    'events' => $events,
    'eventRender' => new JsExpression(<<< 'JS'
(eventObj, $el)=>{
  $el.popover({
    title: eventObj.title,
    content: eventObj.description,
    trigger: 'hover',
    placement: 'top',
    container: 'body'
  });
}
JS
    )
]);
philippfrenzel commented 5 years ago

Thanks - and thanks for sharing ;)