怎么利用dhtmlxscheduler.js实现排课功能?

wenwen1 发布于 2013/08/27 10:36
阅读 1K+
收藏 0
<%@ page language="java" isELIgnored="false" contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<jsp:directive.include file="/WEB-INF/sitemesh-decorators/include.jsp"/>
<head>
<meta name="decorator" content="ijquery"/>
<script src="${pageContext.request.contextPath}/js/dhtmlx/dhtmlxscheduler.js" type="text/javascript"></script> 
<script src="${pageContext.request.contextPath}/js/dhtmlx/ext/dhtmlxscheduler_limit.js"  type="text/javascript" charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/js/dhtmlx/ext/dhtmlxscheduler_timeline.js" type="text/javascript" charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/js/dhtmlx/ext/dhtmlxscheduler_serialize.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/js/dhtmlx/dhtmlxscheduler.css" type="text/css" title="no title" charset="utf-8">
<style type="text/css" media="screen"> 
    html, body{
        margin:0px;
        padding:0px;
        height:100%;
        overflow:hidden;
    }
    .dhx_cal_event_line.custom, .dhx_cal_event.custom div{
        background-color:#fd7;
        border-color:#da6;
        color:#444;
    }
</style>
<script type="text/javascript">
var sections;
var sss=${idKey};
       var year=${year};
       var month=${month};
       var day=${day};
function init() {

scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.config.first_hour = 2;
scheduler.config.last_hour = 20;
scheduler.config.details_on_create = true;
scheduler.locale.labels.timeline_tab = "Timeline";
scheduler.locale.labels.section_custom = "Section";

 $.get("${pageContext.request.contextPath}/getAllSchoolClasses",function(data){
 sections=data.rows;
 });      
alert(sections);
scheduler.createTimelineView({
name: "timeline",
x_unit: "day",
x_date: "%D, %F %j",
x_step: 1,
x_size: 7,
x_start: 0,
x_length: 7,
y_unit: sections,
y_property: "section_id",
dx: 50,
render:"bar"
});
scheduler.date.timeline_start = scheduler.date.week_start;
scheduler.locale.labels.section_checkbox = 'Checkbox';
scheduler.config.lightbox.sections=[
{name:"description", height:130, map_to:"text", type:"textarea" , focus:true},
{ name: "checkbox", map_to: "checkbox", type: "checkbox", checked_value: "registrable", unchecked_value: "unchecked" },
{name:"time", height:72, type:"time", map_to:"auto"}
];
scheduler.init('scheduler_here',new Date(year,month,day),"Timeline");
}
</script>

</head>

<body onload="init();">
<div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
<div class="dhx_cal_navline">
<div class="dhx_cal_prev_button">&nbsp;</div>
<div class="dhx_cal_next_button">&nbsp;</div>
<div class="dhx_cal_tab" name="timeline_tab" style="right:280px;"></div>
</div>
<div class="dhx_cal_header">
</div>
<div class="dhx_cal_data">
</div>
</div>
</body>
页面显示成这样

不能编辑而且不能任何自动选择节次,这该怎么办啊?

加载中
返回顶部
顶部