Jquery实现超酷的日程安排插件

n42g的头像 n42g 11 2015-01-01 21:59 2

 基本信息

× 1   

浏览数: 8117

分享时间: 4 年 前

2

这是一款功能超强大的插件,它可以自由管理自己的日程安排,有3种模式,分别为日,周,月,这样的话管理起来就非常清晰,如果想要保存数据,那就要配合后台程序了。

<script type="text/javascript">
    $(document).ready(function() {
        //[id,title,start,end,全天日程,跨日日程,循环日程,theme,'','']          
       var view="week";          
         __CURRENTDATA=[['6147','你好啊',new Date(1338427800000),new Date(1338431400000),0,0,1,0,1,'','']];
        var op = {
            view: view,
            theme:3,
            showday: new Date(),
            EditCmdhandler:Edit,
            DeleteCmdhandler:Delete,
            ViewCmdhandler:View,    
            onWeekOrMonthToDay:wtd,
            onBeforeRequestData: cal_beforerequest,
            onAfterRequestData: cal_afterrequest,
            onRequestDataError: cal_onerror, 
            url: "calendar.php?mode=get" ,  
            quickAddUrl: "calendar.php?mode=quickadd" ,  
            quickUpdateUrl: "calendar.php?mode=quickupdate" ,  
            quickDeleteUrl:  "calendar.php?mode=quickdelete" //快速删除日程的
           /* timeFormat:" hh:mm t", //t表示上午下午标识,h 表示12小时制的小时,H表示24小时制的小时,m表示分钟
            tgtimeFormat:"ht" //同上 */             
        };
        var $dv = $("#calhead");
        var _MH = document.documentElement.clientHeight;
        var dvH = $dv.height() + 2;
        op.height = _MH - dvH;
        op.eventItems =__CURRENTDATA;

        var p = $("#gridcontainer").bcalendar(op).BcalGetOp();
        if (p && p.datestrshow) {
            $("#txtdatetimeshow").text(p.datestrshow);
        }
        $("#caltoolbar").noSelect();

        $("#hdtxtshow").datepicker({ picker: "#txtdatetimeshow", showtarget: $("#txtdatetimeshow"),
        onReturn:function(r){                          
                        var p = $("#gridcontainer").BCalGoToday(r).BcalGetOp();
                        if (p && p.datestrshow) {
                            $("#txtdatetimeshow").text(p.datestrshow);
                        }
                 } 
        });
        function cal_beforerequest(type)
        {
            var t="正在加载数据...";
            switch(type)
            {
                case 1:
                    t="正在加载数据...";
                    break;
                case 2:                      
                case 3:  
                case 4:    
                    t="正在处理请求...";                                   
                    break;
            }
            $("#errorpannel").hide();
            $("#loadingpannel").html(t).show();    
        }
        function cal_afterrequest(type)
        {
            switch(type)
            {
                case 1:
                    $("#loadingpannel").hide();
                    break;
                case 2:
                case 3:
                case 4:
                    $("#loadingpannel").html("操作成功!");
                    window.setTimeout(function(){ $("#loadingpannel").hide();},2000);
                break;
            }              

        }
        function cal_onerror(type,data)
        {
            $("#errorpannel").show();
        }
        function Edit(data)
        {
           var eurl="";   
            if(data)
            {
                var url = StrFormat(eurl,data);
                OpenModelWindow(url,{ width: 600, height: 400, caption:"管理日程",onclose:function(){
                   $("#gridcontainer").BCalReload();
                }});
            }
        }    
        function View(data)
        {
            var vurl="";   
            if(data)
            {
                var url = StrFormat(vurl,data);
                OpenModelWindow(url,{ width: 600, height: 400, caption: "查看日程"});
            }                
        }    
        function Delete(data,callback)
        {  
            $.alerts.okButton="确定";  
            $.alerts.cancelButton="取消";  
            hiConfirm("是否要删除该日程?", '确认',function(r){ r && callback(0);});           
        }
        function wtd(p)
        {
           if (p && p.datestrshow) {
                $("#txtdatetimeshow").text(p.datestrshow);
            }
            $("#caltoolbar div.fcurrent").each(function() {
                $(this).removeClass("fcurrent");
            })
            $("#showdaybtn").addClass("fcurrent");
        }
        //显示日视图
        $("#showdaybtn").click(function(e) {
            //document.location.href="#day";
            $("#caltoolbar div.fcurrent").each(function() {
                $(this).removeClass("fcurrent");
            })
            $(this).addClass("fcurrent");
            var p = $("#gridcontainer").BCalSwtichview("day").BcalGetOp();
            if (p && p.datestrshow) {
                $("#txtdatetimeshow").text(p.datestrshow);
            }
        });
        //显示周视图
        $("#showweekbtn").click(function(e) {
            //document.location.href="#week";
            $("#caltoolbar div.fcurrent").each(function() {
                $(this).removeClass("fcurrent");
            })
            $(this).addClass("fcurrent");
            var p = $("#gridcontainer").BCalSwtichview("week").BcalGetOp();
            if (p && p.datestrshow) {
                $("#txtdatetimeshow").text(p.datestrshow);
            }

        });
        //显示月视图
        $("#showmonthbtn").click(function(e) {
            //document.location.href="#month";
            $("#caltoolbar div.fcurrent").each(function() {
                $(this).removeClass("fcurrent");
            })
            $(this).addClass("fcurrent");
            var p = $("#gridcontainer").BCalSwtichview("month").BcalGetOp();
            if (p && p.datestrshow) {
                $("#txtdatetimeshow").text(p.datestrshow);
            }
        });

        $("#showreflashbtn").click(function(e){
            $("#gridcontainer").BCalReload();
        });

        //点击新增日程
        $("#faddbtn").click(function(e) {
            var url ="";
            OpenModelWindow(url,{ width: 500, height: 400, caption: "新增日程"});
        });
        //点击回到今天
        $("#showtodaybtn").click(function(e) {
            var p = $("#gridcontainer").BCalGoToday().BcalGetOp();
            if (p && p.datestrshow) {
                $("#txtdatetimeshow").text(p.datestrshow);
            }

        });
        //上一个
        $("#sfprevbtn").click(function(e) {
            var p = $("#gridcontainer").BCalPrev().BcalGetOp();
            if (p && p.datestrshow) {
                $("#txtdatetimeshow").text(p.datestrshow);
            }

        });
        //下一个
        $("#sfnextbtn").click(function(e) {
            var p = $("#gridcontainer").BCalNext().BcalGetOp();
            if (p && p.datestrshow) {
                $("#txtdatetimeshow").text(p.datestrshow);
            }
        });
        $("#changetochinese").click(function(e){
            location.href="?lang=zh-cn";
        });
        $("#changetoenglish").click(function(e){
            location.href="?lang=en-us";
        });
         $("#changetoenglishau").click(function(e){
            location.href="?lang=en-au";
        });

    });
</script>


12 3 4 5 6 [下一页]

  • Angela52的头像 Angela52 2018-11-13 19:41 代码数:0

    Modern JavaScript: easy, but comprehensive explanations with examples and assignments, including closures, document, and events, essay writing websites object-oriented programming ...

  • ossaa的头像 ossaa 2018-05-08 19:34 代码数:0

    Your music is amazing. You have some very talented artists. I wish you the best of success.

    estate planning whittier

  • ossaa的头像 ossaa 2018-05-12 20:37 代码数:0

    This is such a great resource that you are providing and you give it away for free.

    SEO

  • david230的头像 david230 2018-12-21 14:40 代码数:0

    I am David tylor. I am an Fashion content writer and editor, associated with GotoAssignmentHelp for a decade. GotoAssignmentHelp is leading plagiarism free assignment writing help in Australia. We provide customized assignment help service.We are leading the market for more than a decade now and have acquired the name of being the best academic help service for our comprehensive services at pocket-friendly rates.

    Need Assignment Help?
     

    psychology assignment writing service
    Online Java Programming Language Assignments Help
    PHP Programming Assignment Help Service 

    Writing academic documents is a task most students prefer to leave up to the subject matter experts. This is because most of them are complex and comprehensive, the research for which consumes a large portion of their valuable time. During higher studies in colleges, students often have to prepare multiple documents, quizzes and surprise tests. This is the main reason why most students search for assignment help over the internet and choose only the most proficient and trusted academic writing experts. 
     

    assignment writing company
    javascript homework assignments Help
    Help with C++ Programming Assignment Help
    programming language assignment expert

    The increasing importance of writing assignments has prompted students to take a helping hand from assignment writing services. During higher studies in colleges, students often have to prepare multiple documents, quizzes and surprise tests. This is the main reason why most students search for assignment help Australia over the internet and choose only the most proficient and trusted academic writing experts. An assignment of IT is a scope to dig out new information and uncover the facts which could be a parallel study along with implanting it by creating new area of IT application. He starts disliking his school or college. Therefore, it is advisable for students to seek professional law assignment helps. Experience the best marketing assignment services at Australian Assignment Help with its quality my assignment helper well qualified from major universities. Get Online Assignment Helper Service by Professional Writers.
     

    Help with C# Programming Assignment Help
    hr assignment help online

  • ossaa的头像 ossaa 2018-05-13 22:21 代码数:0

    I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business.

    Nebraska SEO services

  • ossaa的头像 ossaa 2018-12-22 16:53 代码数:0

    I am very much pleased with the contents you have mentioned. I wanted to thank you for this great article.

    Tax Preparation Tucson

  • ossaa的头像 ossaa 2018-12-22 19:03 代码数:0

    I am happy to find this post very useful for me, as it contains lot of information. I always prefer to read the quality content and this thing I found in you post. Thanks for sharing.

    Sports doctor Lubbock

  • Johnie77的头像 Johnie77 2018-11-02 15:14 代码数:0

    It is indeed a very effective procedure. Fast essay help

  • ossaa的头像 ossaa 2018-05-14 21:48 代码数:0

    I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.

    Montana ranches for sale

  • gererik的头像 gererik 2018-07-01 19:45 代码数:0

    This article is an appealing wealth of informative data that is interesting and well-written.  I commend your hard   work on this and thank you for this information.  You’ve got what it takes to get attention.  Brazilian plastic surgeon

您的评论: