这段时间由于帮公司做套餐打包项目,在做到时间价格表的时候出现一个问题:使用fullCalendar日历插件的时候出现点击进入时间价格表页面第一次日历插件和规则页面全部能加载出来,但是第二次加载的时候却只能加载下面规则的页面.
下面贴出代码:
1.日历插件页面.
<%@page contentType="text/html" pageEncoding="UTF-8"%>
$(function(){
$('#myCalendar').fullCalendar({
header: {
right: 'next today',
center: 'title',
left: 'prev'
},
aspectRatio:4,
theme: true,
editable: true,
allDaySlot: false,
timeFormat: 'HH:mm{ - HH:mm}',
viewDisplay: function (view) {//动态把数据查出,按照月份动态查询
var url = "/tnt_price/timePrice/route/queryGoodsTimePriceList.do";
var specDate = $.fullCalendar.formatDate(view.start, "yyyy-MM-dd");
$("#myCalendar").fullCalendar('removeEvents'); //清空上次加载的日志.
$("#fullmonthprojects").empty();
$.post(url, {unitId:"${unitId}",distId:"${userId}",packType:"${packType}",specDate:specDate,productId:"${productId}",categoryId:"${categoryId}"},function (data) {
for(var i=0;i ............ $td.find("div.fill_data").html(""+liArray.join('')+"
").css({'height':'auto'});
}
}); //把从后台取出的数据进行封装以后在页面上以fullCalendar的方式进行显示
}
});
setTimeout(
function () {
var selectdate = new Date();
$('#myCalendar').fullCalendar('gotoDate', selectdate.getFullYear(), selectdate.getMonth(), selectdate.getDate());
}, 100
);
});
2.进入时间价格表链接的代码:
$(function(){
$(".showAutoTimePrice").live("click",function(){
$time_price_dlg = null;
var param = $(this).attr("param");
if ($(this).attr("tt") != 'DIST_PROD_PRODUCT') {
alert("您访问的时间价格表类型错误.");
return false;
}
current_time_price_param = eval("(" + param + ")");
var distId = current_time_price_param.distId;
var channelId = current_time_price_param.channelId;
var packageId = current_time_price_param.saleUnitId;
var packageType = current_time_price_param.packageType;
var combineType = current_time_price_param.combineType;
var packType = current_time_price_param.packType;
var categoryId = current_time_price_param.categoryId;
var time_price_param = {'distId':distId,'unitId':packageId,'packType':packType,'categoryId':categoryId};
if ($time_price_dlg == null) {
$time_price_dlg = $("