zoukankan      html  css  js  c++  java
  • 关于dhtmlxScheduler的使用说明(ADD EDIT DEL,自定义CelendarBox)【转】

    引自 http://www.cnblogs.com/smildlzj/archive/2010/01/07/1641755.html

    dhtmlxScheduler是一个JavaScript日程安排控件,类似于Google日历。日历事件通过Ajax动态加载,支持通过拖放功能调整事件日期和时间。事件可以按天,周,月三个种视图显示。

    dhtmlxScheduler[ Calendars - 日历组件 ]

    Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->function CalendarInit(sid,operator) {
    
        Owner=(sid==operator);
        scheduler.config.first_hour=8;
        scheduler.config.api_date="%Y-%m-%d %H:%i";
        scheduler.config.xml_date="%Y-%m-%d %H:%i";
        scheduler.config.hour_date="%H:%i";
        scheduler.config.default_date="%Y年%m月%d日";
        scheduler.config.month_date="%Y年 %m月";
        scheduler.config.day_date="%m月%d日";
        scheduler.config.start_on_monday=true;
        //scheduler.config.update_render=true;
        if(!Owner)
        {
            scheduler.config.drag_resize=false; 
            scheduler.config.drag_move=false; 
            scheduler.config.drag_create=false; 
            scheduler.config.dblclick_create=false;
            scheduler.config.edit_on_create=false;
            scheduler.config.details_on_create=false;
    
            if(!Permission.Edit)
            {
                scheduler.config.readonly=true;
                scheduler.attachEvent("onClick",function(id){
                    CelendarBox(id);
                });
            }
        }
        
        scheduler.showLightbox = CelendarBox;
        scheduler.attachEvent("onBeforeEventDelete",Del);
        scheduler.attachEvent("onEventChanged", function(event_id,event_object){
             //alert("onEventChanged: "+event_id);
             Edit(event_id,event_object);
         });
        scheduler.attachEvent("onEventAdded", function(event_id,event_object){
             //alert("onEventAdded: "+event_id);
             Add(event_id,event_object,function(old_id,new_id){
                 scheduler.changeEventId(old_id, new_id);
             });
        });
        scheduler.locale={
            date:{
                month_full:["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
                month_short:["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"],
                day_full:["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
                day_short:["日", "一", "二", "三", "四", "五", "六"]
            },
            labels:{
                dhx_cal_today_button:"今天",
                day_tab:"日",
                week_tab:"周",
                month_tab:"月",
                new_event:"新工作计划",
                icon_save:"保存",
                icon_cancel:"取消",
                icon_details:"详细",
                icon_edit:"编辑",
                icon_delete:"删除",
                confirm_closing:"", //Your changes will be lost, are your sure?
                confirm_deleting:"请确认你是否需要删除该工作计划?",
                section_content:"内容",
                section_views:"上级意见",
                section_time:"时间"
            }
        };
        scheduler.init('scheduler_here',null,"week");
        scheduler.load("./ListData.action?sid="+sid+"&r="+Math.random());    
    
    }

    代码说明一下:

    CalendarInit:这个是初始化日历的函数,是我从实际项目复制过来,无删减。

    sid:所有者ID

    operator:操作者ID

    Owner=(sid==operator);//判断是否为所有者

    Permission.Edit:(true、false),是否有修改权限

  • 相关阅读:
    C#多线程同步重新梳理
    word打不开,Microsoft Office Word 遇到问题需要关闭。。。总提示进入安全...
    SMTP协议
    【转载】Hadoop集群(第10期)_MySQL关系数据库 天高地厚
    备份与恢复的原理 . 天高地厚
    ubuntu server 使用parted分区 天高地厚
    Flex开发中遇到未整理资源 天高地厚
    Oracle RAC + Data Guard 环境搭建 . 天高地厚
    【转载】oracle事务之oracle读一致性 . 天高地厚
    理解PGA(2)pga_aggregate_target详解 . 天高地厚
  • 原文地址:https://www.cnblogs.com/macula/p/3077912.html
Copyright © 2011-2022 走看看