【发布时间】:2014-12-16 06:22:42
【问题描述】:
当点击它时,我需要获取所选事件的id 的值。对话框打开后,我有一个链接将重定向到另一个页面。我需要将eventid 传递给控制器以将其用于重定向页面。
我似乎无法解决这个问题,已经解决了一个星期。
这是我的脚本:
<script type='text/javascript'>
$(document).ready(function(){
$('#calendar').fullCalendar({
header : {
left: 'prev,next',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
allDay: false,
events: "<?php echo site_url('home/calendarList') ?>",
eventClick: function(event, jsEvent, view) {
//set the values and open the modal
$("#startTime").html(moment(event.start));
$("#startTime").html(moment(event.start).format('h:mm A'));
$("#endTime").html(moment(event.start).add('hours',1).format('h:mm A'));
$("#eventInfo").html(event.description);
$("#eventIssue").html(event.issue);
$("#eventrefid").html(event.id); //i need to pass the value of this
//to my controller and
//which will be used in another page
//(no ajax needed if possible)
$("#eventID").html(event.issue);
$("#eventLink").attr('href', event.url);
$("#eventContent").dialog({ modal: true, title: event.title });
$(this).css('border-color', 'red');
}
});
});
</script>
这是我的 HTML 代码:
<section>
<div class="content" id="eventContent" title="Event Details" style="display:none;">
<?= form_open('home/accomplish_appointment');?>
<span style="font-weight: bold;">From:</span> <span id="startTime"></span><br>
<span style="font-weight: bold;">To: <span id="endTime"></span>
<hr>
<span style="font-weight: bold;">Issue: <span id="eventIssue"></span><br>
<span style="font-weight: bold;">Special Instruction: <span id="eventInfo"></span><br><br>
<button class="fr submit small" type="submit" id="eventLink">Accomplish Appointment</button>
<?= form_close();?>
</div>
</section>
【问题讨论】:
-
对不起,你要什么链接? :(
-
@AfghanWiz 哦,你的意思是 eventlink?该链接似乎不起作用,当我单击 Accomplish Appointment 按钮时,它只是重定向到 = form_open('home/accomplish_appointment');?>跨度>
-
请帮忙,我是 jquery 新手
-
@AfghanWiz 如果你要一个测试链接,我没有它:(
-
好的,您是否已经拥有您在此处所述的 eventid:
$("#eventrefid").html(event.id);
标签: javascript jquery codeigniter fullcalendar