allow ajax data parameter to be specified as a function

(test updated by arshaw after-the-fact)
This commit is contained in:
Paul Gallagher
2013-07-29 23:14:37 -07:00
committed by Adam Shaw
parent 155b78cc1a
commit c93f64fc8b
2 changed files with 61 additions and 1 deletions
+54
View File
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<link href='../build/out/fullcalendar.css' rel='stylesheet' />
<link href='../build/out/fullcalendar.print.css' rel='stylesheet' media='print' />
<script src='../build/out/jquery.js'></script>
<script src='../build/out/jquery-ui.js'></script>
<script src='../build/out/fullcalendar.js'></script>
<script>
$(document).ready(function() {
$('#calendar').fullCalendar({
year: 2010,
month: 0,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,basicWeek,agendaDay,basicDay'
},
editable: true,
events: {
url: "many_events_json.txt",
data: function() {
var custom_data = { q: 'custom data value' }; // should see this in Networking
console.log('setting custom_data as part of the eventSource fetch');
return custom_data;
}
}
});
});
</script>
<style>
body {
margin-top: 40px;
text-align: center;
font-size: 13px;
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
}
#calendar {
width: 900px;
margin: 0 auto;
}
</style>
</head>
<body>
<div id='calendar'></div>
</body>
</html>