gpt4 book ai didi

javascript - fullcalendar 不允许我调整事件的大小(光标不显示,我做错了)

转载 作者:行者123 更新时间:2023-11-28 11:08:20 27 4
gpt4 key购买 nike

嗨,堆栈跟踪错误追踪者,我来这里寻求帮助...我在 symfony2 上,使用 twitter bootstrap,我拼命地尝试通过执行以下操作来调整通过 JSON 发送到日历的元素的大小接下来,我可以拖动事件,但不能调整它们的大小...:

屏幕截图:http://nimga.fr/f/oDrdH.png

进入 Controller :

foreach($events as $event) {

$start = $event - > getDate();
$allDay = ($event - > getLength() >= 8);
$newevent = array('title' = > $event - > getTask() - > getName(),
'start' = > $start - > format('Y-m-d H:i:s'),
'id' = > $event - > getId(),
'allDay' = > $allDay,
'end' = > $start - > modify('+'.$event - > getLength().
' hour') - > format('Y-m-d H:i:s'));
$eventsArray[] = $newevent;
}
return $this - > render('IntranetTimesheetBundle:Task:displayall.html.twig', array('htmlTree' = > $htmlTree, 'eventlist' = > json_encode($eventsArray)));

在 View 中:

$('#calendar').fullCalendar({
droppable: true, // this allows things to be dropped onto the calendar !!!
weekends: false, // will hide Saturdays and Sundays
defaultView: 'agendaWeek',
slotMinutes: 60,
minTime: 7,
maxTime: 19,
events: {
{
eventlist | raw
}
},
editable: true,
resizable: true,
eventDrop: function (event, dayDelta, minuteDelta, allDay, revertFunc) {
var DATA = {
"event_title": event.title,
"event_id": event.id,
"event_date": event.start,
"dayDelta": dayDelta,
"minuteDelta": minuteDelta,
"allDay": allDay
};
$.ajax({
type: "POST",
url: "move",
data: DATA,
cache: false,
success: function (data) {
//to do in case of success
}
});
},
eventResizeStart: function (event, jsEvent, ui, view) {
console.log('RESIZE START ' + event.title);

},
eventResizeStop: function (event, jsEvent, ui, view) {
console.log('RESIZE STOP ' + event.title);

},
eventResize: function (event, dayDelta, minuteDelta, revertFunc, jsEvent, ui, view) {
console.log('RESIZE!! ' + event.title);
console.log(dayDelta + ' days'); //this will give the number of days you extended the event
console.log(minuteDelta + ' minutes');

}
})

我得到了 jQuery,它的 UI 和可放置的扩展已加载,但仍然没有箭头光标表明我可以调整事件的大小。这是我的头与“依赖项”

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
<link rel='stylesheet' type='text/css' href="http://arshaw.com/js/fullcalendar-1.6.4/fullcalendar/fullcalendar.css" />
<link rel='stylesheet' type='text/css' href="http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/1.6.4/fullcalendar.print.css" />
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/1.6.4/fullcalendar.min.js"></script>

最佳答案

最后我找到了解决方案:将 allDay 添加到每个事件!

var event = {
start: startEvent,
end: endEvent,
title: "Test",
allDay: true
}

关于javascript - fullcalendar 不允许我调整事件的大小(光标不显示,我做错了),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20615779/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com