- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用完整日历。它运行良好。但我在通过 onclick 事件发送参数时遇到问题。我有这个js:
<script>
$(document).ready(function() {
$('#calendar').fullCalendar({
theme: true,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: false,
minTime: 8,
maxTime: 21,
weekMode: 'liquid',
eventClick: function(start, end, allDay) { // Get the start, end, allday when one event slot is clicked
$('#time').val(start); // Set an hidden field with start value (String or Timestamp)
$('#hiddenEnd').val(end); // Set another hidden field with end value (String or Timestamp)
$('#hiddenAllDay').val(allDay); // Set another hidden field with allDay value (true or false)
},
events: "<?php echo Yii::app()->request->baseUrl; ?>/index.php/aula/calend/<?php echo $id; ?>",
eventRender: function (event, element) {
element.attr('href', 'javascript:void(0);');
element.attr('onclick', 'openModal("' + event.title + '","' + event.description + '","' + event.start + '");');
},
eventDrop: function(event, delta) {
alert(event.title + ' foi movido ' + delta + ' dia(s)\n' +
'(Esta acao nao altera o banco de dados!)');
},
loading: function(bool) {
if (bool) $('#loading').show();
else $('#loading').hide();
}
});
});
function openModal(title, info, start) {
$("#eventInfo").html(info);
$("#start-time").val(start);
//var dd = start;
$("#add-event").dialog({ modal: true, title: title, width:550,
buttons: {
"Salvar": function() {
$.ajax({
type:"POST",
url: "<?php echo Yii::app()->request->baseUrl; ?>/index.php/aula/marcacao",
data: $('#add-event-form').serialize(),
success: function(){
$('#calendar').fullCalendar('refetchEvents');
}
});
$(this).dialog("close");
},
Cancel: function() {
$(this).dialog("close");
}
},});
};
当我单击一个事件时,我需要将该事件的小时发送到 php,因为我需要在使用此表单打开对话框之前在查询中使用它:
<form action="" id ="add-event-form" name="add-event-form">
<?php query = "SELECT aula FROM cursos WHERE hour = ****Hour clicked on calendar**** ?>
<label for="title">Event Name</label>
<input type="text" name="title" id="title"/>
<p>
<label for="add-date">Date</label>
<input type="text" name="event-date" id="event-date" tabindex="-1" />
</p>
<p>
<label for="add-start-time">Start Time</label>
<input type="text" name="start-time" id="start-time" value=""/>
</p>
<p>
<label for="add-end-time">End Time</label>
<input type="text" name="end-time" id="end-time" />
</p>
</form>
我已经尝试解决这个问题好几天了,但没有成功。有人可以帮我吗?
最佳答案
不要使用 eventClick: function(start, end, allDay)
,而是使用 eventClick: function(event)
。然后使用 event.start、event.end、event.allDay 访问变量。然后您需要做的就是将它们与您的查询相匹配。
这是因为 eventClick 不采用 start、end 或 allDay 参数,而是采用事件、jsEvent 或 View 参数。来源:Official Documentation
关于javascript - 通过onclick全日历发送参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24266971/
Apache服务器全局配置之服务器标识配置篇 服务器标识相关指令: ServerName ServerAdmin ServerSignature ServerTokens UseCanonical
//校验是否全由数字组成 ? 1
具体内容如下: 1 os.system 例如 ipython中运行如下命令,返回运行状态status os.system('cat /etc/passwdqc.conf') min=disab
基本操作 查看数据库 ? 1
Xcode使用教程详细讲解是本文要介绍的内容,Xcode是一个款强大的IDE开发环境,就像你在写Windows程序时需要VS2005一样 需要要Xcode为你写Mac程序提供环境。因此,如果你要成为
就如今天遇到随即函数rand();脑海中想到用它做点啥好呢,最后想起了验证码,数字验证码,字母验证码,中文验证码,可是自己不会呀,咋办呢,上网搜,看别人的代码,开不懂,看视频,听老师讲,将其中所遇到
pcre-7.8.tar.gz 正则表达式下载地址:ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
IDEA常用设置(提高开发效率) 本人也是IDEA编译器的忠实用户了,但是有时出于各种原因,比如更换设备等等,IDEA总是需要重新安装配置。这就让我比较苦恼,因为总是记不全自己之前都修改了
? 1 2
1、 操作环境搭建 系统:Windows7 旗舰版 64位 PHP环境:wampserver2.2e-php5.4.3-httpd2.2.22-mysql5.5.24 32
关闭。这个问题是opinion-based 。目前不接受答案。 想要改进这个问题吗?更新问题,以便 editing this post 可以用事实和引文来回答它。 . 去年关闭。 Improve th
我已经为我在 Adobe Fireworks Cs5 中构建的页面生成了 css,我想知道如何为我的标题和其他 div 设置完整宽度。我将显示标题部分的 css 代码。 @charset "utf
您好,我希望表单宽度为 100%。我希望文本框几乎延伸整个页面的宽度,并在文本框的右侧直接放置小的“GO”按钮,所有按钮都在同一行(或 block )上。 现在我的文本框只有其中文本的宽度(“在此处输
我没有设法将全宽页脚粘贴到网页底部。当页脚上方的主要内容低于一定高度时,页脚下方有一个空白区域。我尝试使用各种解决方案,例如以下 css 代码: html,body { margin:0; padd
我想要一个全宽的表格。当我给 position:fixed; 它变成全宽但可滚动不起作用。 简而言之,我需要一个与浏览器主体没有任何边距的表格。 body { font-family: "Helv
我注意到很多大型网站(如 Google 和 Facebook)在查看页面源代码时 99% 的源代码都是 JavaScript。 有人知道这种方法相对于常规 HTML+JavaScript 页面的优势吗
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 8 年前。 Improve this q
由于某种原因,我网站上的图片不再是全宽的。 据我所见,所有内容都设置为 100% 宽度。 http://cargocollective.com/btatest 我是不是什么地方都没有? 最佳答案 我认
我正在创建一个菜单并尝试使用 CSS 制作全宽菜单。但是,我不确定菜单项将如何出现在菜单中。 这是问题的截图: 问题出在我得到的“GAP”中。 如果我有固定数量的元素,我知道我可以使用这个逻辑: ul
这个问题在这里已经有了答案: Puzzle: Find largest rectangle (maximal rectangle problem) (6 个答案) 关闭 9 年前。 给定一个二元矩阵
我是一名优秀的程序员,十分优秀!