---
title: "尝试 dhtmlxScheduler"
author: "ynial"
date: "2010-08-19T14:02:46Z"
tags: []
categories: ["Web前端"]
slug: "dhtmlxscheduler"
draft: false
lastmod: "2010-08-19T14:05:33Z"
id: 741092
url: "https://ynial.iteye.com/blog/741092"
---

dhtmlxScheduler
下载地址：http://dhtmlx.com/docs/products/dhtmlxScheduler/download/dhtmlxScheduler.zip
![](http://dl.iteye.com/upload/attachment/295433/25865921-50aa-36f4-a98d-ebdc48588db7.jpg)

```html

<!-- 加载类库 -->
<script src="../../codebase/dhtmlxscheduler_debug.js" type="text/javascript" charset="utf-8"></script>
<!-- 加载国际化语言包(中文) -->
<script src="../../sources/locale_cn.js" type="text/javascript" charset="utf-8"></script>

```



```html

function init() {
		scheduler.config.multi_day = true;
		
		scheduler.config.xml_date="%Y-%m-%d %H:%i";
		scheduler.init('scheduler_here',null,"day");


		//监听事件被添加
		scheduler.attachEvent("onEventAdded", function(event_id,event_object){
                        //在这里可以向后台发送ajax请求 把前台添加的事件信息发送到后台



			alert(event_id);
		});
		
		//点击明细后、当事件被保存
		scheduler.attachEvent("onEventSave",function(id, data){
			if (!data.text) {
				//如果内容是空的那么弹出警示框
				alert("Text must not be empty");
				return false;
			}
			//这个id是一个唯一值
			alert(id);
                        //在这里可以向后台发送ajax请求 删除的请求
			return true;
		});
		
		//点击明细后、当事件被保存
		scheduler.attachEvent("onBeforeEventDelete", function(id, data){
			alert(id);
                        //在这里可以向后台发送ajax请求 保存或者修改的请求
			return true;
		});
		
		
		
	}


```