$.ajax({
url: 'events/create',
type: "GET",
data: {
date: date
},
success: function(data) {
$('#crEvent').modal('show')
.find('#modalContent')
.html(data);
},
error: function() {
alert('Error');
}
});
$('#calendar').fullCalendar({
eventClick: function(calEvent, jsEvent, view) {
url = 'http://site.com/default/view?id=' + calEvent.id;
// then Ajax loaded the content to display url
// display it in the previously harvested vsplyvala
// and display it
}
});
<button type="button" data-toggle="modal" data-url="/myurl" data-header="some header"></button>
call "view" for each event a,
the click event
Find more questions by tags Yii
Yii2 widget is essentially a wrapper for the JS-plugin, which creates a JS object and configures it according to the specified settings. In this widget if I am not mistaken, the responses to the events can be konfigurierbare through property clientOptions, i.e.:
- bryana.Renn commented on July 9th 19 at 10:38
pastebin.com/Z2D9Rvs7 - index.php;
pastebin.com/5M87vW7b - EventsController;
pastebin.com/Jtzg5dTG - calendar.js - Jayne_Windler commented on July 9th 19 at 10:41
'eventClick' => new JsExpression("function(event) {
alert(event.id);
}")
And it worked!Gives the id of the event! Thanks for the tip!
Now we have to figure out how to call via ajax view with this ID, and even in a modal window and to update is also in the same window, called... - Jayne_Windler commented on July 9th 19 at 10:50
onClick' =>"$('#view').find('.modal-body').load($(this).attr('href')); $('#edit').modal('show'); return false;" - bryana.Renn commented on July 9th 19 at 10:59