我希望ajax请求应该在页面加载时发送默认日期
$(document).ready(function(){
$('#schedule_datepicker').datepicker({dateFormat:'yy-mm-dd'}).datepicker("setDate", new Date()).on("change", function () {
var dataTable = $('.table-wrap').DataTable( {
"processing": true,
"serverSide": true,
"bDestroy": true,
"ajax":{
url: '<?php echo TEMPLATES_URI."schedule_ajax.php"; ?>',
type: "post",
data:{date_time:$('#schedule_datepicker').val()},
error: function(){
$(".employee-grid-error").html("");
$("#employee-grid").append('<tbody class="employee-grid-error"><tr><th colspan="3">No data found in the server</th></tr></tbody>');
$("#employee-grid_processing").css("display","none");
}
}
});
});
使用新日期ajax请求应发送