Reputation: 102
I am trying to implement dialog windows for events in fullcalendar instead alert and prompt window in a easy way. Any example will be really apreciated.
select: function(start, end, allDay) {
var title = bootbox.prompt("Hello World!", function(result) {
if (result) {
if (title) {
var start = $.fullCalendar.formatDate(start, "yyyy-MM-dd HH:mm:ss");
var end = $.fullCalendar.formatDate(end, "yyyy-MM-dd HH:mm:ss");
$.ajax({
url: 'add_events.php',
data: 'title='+ title+'&start='+ start +'&end='+ end,
type: "POST",
success: function(json) {
bootbox.alert('Added Successfully');
}
});
}
});
Upvotes: 0
Views: 1241
Reputation: 571
Take a look at some CSS/JS frameworks like Twitter Bootstrap or Zurb (there are others, some specifically for this kind of thing). Generally, they will have Modals/Dialogs/alerts that can be called programmatically from JS.
e.g.
success: function(json) {
$(".alert").alert(); //Bootstrap alert popup
}
Upvotes: 1