Closed hendynugraha closed 5 years ago
So open or not open ;) Are you passing params correct?
Hi Philip, believe you're doing well. in truth, it's great to hear from you. Basically I need to filter events as per codes above and until right now those codes it's not working. this issue is still open. really really hope you can give a sample of how to implement filter events based on select option. anyway, your Full Calendar is awesome :)
thanks @hendynugraha -> so this sounds like you solved it -> I will close it for now ;)
Greetings Programmers,
I'm using Philipp Frenzel FullCalendar in Yii2 Framework and its working perfectly. I want to implement simple filter events on calendar base on option select but my codes still not working. Help would be highly appreciated.
This in inside Event - index.php :
`<?php
use yii\helpers\Html; use yii\grid\GridView; use yii\bootstrap\Modal;
$this->title = 'Roster Bul Hanine Project'; $this->params['breadcrumbs'][] = $this->title;
$js = <<< JS var eventSource=['/event/filter-events']; $("#select_name").on('change',function() { var eventSourceNew=['/event/filter-events?choice=' + $(this).val()]; $('#event').fullCalendar('removeEventSource', eventSource[0]); $('#event').fullCalendar('addEventSource', eventSourceNew[0]); $('#event').fullCalendar('refetchEvents'); eventSource = eventSourceNew; }); JS; $this->registerJs($js,\yii\web\View::POS_READY);
?>
= Html::encode($this->title) ?>
render('_search', ['model' => $searchModel]); ?>= Html::a('Create Roster', ['create'], ['class' => 'btn btn-success']) ?>
Roster
', 'id' => 'model', 'size' => 'model-lg', ]); echo ""; Modal::end(); ?> =\yii2fullcalendar\yii2fullcalendar::widget(array( //'events'=> $events, 'id' => 'event', 'clientOptions' => [ 'editable' => true, 'eventSources' => ['/event/filter-events'], 'draggable' => true, 'droppable' => true, ], 'eventClick' => "function(calEvent, jsEvent, view) { $(this).css('border-color', 'red'); $.get('index.php?r=event/update',{'id':calEvent.id}, function(data){ $('.modal').modal('show') .find('#modelContent') .html(data); }) $('#calendar').fullCalendar('removeEvents', function (calEvent) { return true; }); }", )); ?>