layer的使用笔记

$('#calendar').fullCalendar({
lang:"zh-cn",
buttonText:{
today: '今天'
},
eventLimit: true,
events:"/device/calibrationPlan/task/load",
//fullcalendar在dayclick事件中获取当前点击日期中的events数组
    dayClick: function(date, jsEvent, view) {
var events = $('#calendar').fullCalendar('clientEvents', function(event) {
            var eventStart = event.start.format('YYYY-MM-DD');
            var eventEnd = event.end ? event.end.format('YYYY-MM-DD') : null;
            var theDate = date.format('YYYY-MM-DD');
            // Make sure the event starts on or before date and ends afterward
            // Events that have no end date specified (null) end that day, so check if start = date
            return (eventStart <= theDate && (eventEnd >= theDate) && !(eventStart < theDate && (eventEnd == theDate))) || (eventStart == theDate && (eventEnd === null));
        });
if(events.length>0){
layer.open({
type: 2,
title: '',
shadeClose: true,
shade: 0.8,
area: ['900px', '600px'],
content: "/device/views/calibrationPlan/calibrationList.html",
success:function(layero, index){

console.log(events)
var body = layer.getChildFrame('body', 1);
var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
body.find("#openTbody").empty();
for(var i=0;i<events.length;i++){
body.find("#openTbody").append("<tr>"
+"<td>"+events[i].data.calibrationName+"</td>"
+"<td>"+events[i].data.classification+"</td>"
+"<td>"+events[i].data.useDepartment+"</td>"
+"<td>"+1+"</td>"
+"<td>"+events[i].data.calibrationMonth+"</td>"
+"<td>"+events[i].data.remarks+"</td>"
+"</tr>");
}

}
});
}
},
});

转载于:https://www.cnblogs.com/sunjinggege/p/7055399.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值