如何在fullcalendar jquery中填写日期? [英] How to fill dates in fullcalendar jquery?

查看:72
本文介绍了如何在fullcalendar jquery中填写日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我的asp.net页面上有fullCalendar控件。



和我有日期值存储在SQL SERVER数据库中。



为此,我编写了存储过程来获取值。



现在,我想在FullCalendar中填写这些值(日期)...



我尝试过:



我必须使用哪种方法来填写fullcalendar中的日期?



事件:{ 
url:'/ myfeed.aspx',
类型:'POST',
数据:{
custom_param1:'something',
custom_param2:'somethingelse'
},
错误:function(){
alert('获取事件时出错!');
},
颜色:'黄色',
textColor:'black'
}





任何人都可以帮帮我吗?





谢谢

解决方案

< blockquote> C#代码:

  public   object  SessionScheduleDates 
{
get
{
string output = ;
if (会话!= null
{
string input = Session.ScheduleDates;
output = [ + \ + input.Replace( \,\)+ \ + ];
}
return 输出;
}
}





< script> 
var ScheduleDates = new 数组();
ScheduleDates =<%= SessionScheduleDates %> ;
for var i = 0 ; i< ScheduleDates.length; i ++){
// alert(ScheduleDates [i]) ;


#calendar) .fullCalendar(' addEventSource',[{
start:ScheduleDates [i],
呈现:' background'
block: true
},]);
}
< / script>


Hi guys,

I have fullCalendar control on my asp.net page.

and I have dates values stored in SQL SERVER DataBase.

For this I wrote stored procedure to get values.

Now, I want to fill these values(dates) in the FullCalendar...

What I have tried:

which method I have to use to fill dates in fullcalendar?

events: {
        url: '/myfeed.aspx',
        type: 'POST',
        data: {
            custom_param1: 'something',
            custom_param2: 'somethingelse'
        },
        error: function() {
            alert('there was an error while fetching events!');
        },
        color: 'yellow',  
        textColor: 'black' 
    }



Can any one please help me?


thanks

解决方案

C# code:

public object SessionScheduleDates
{
    get
    {
        string output="";
        if (Session != null)
        {
            string input = Session.ScheduleDates;
            output = "[" + "\"" + input.Replace(",", "\",\"") + "\"" + "]";
        }
        return output;
    }
}



<script>
    var ScheduleDates = new Array();
    ScheduleDates = <%= SessionScheduleDates %>;
    for (var i = 0; i < ScheduleDates.length; i++) {
        //alert(ScheduleDates[i]);


("#calendar").fullCalendar('addEventSource', [{ start: ScheduleDates[i], rendering: 'background', block: true, }, ]); } </script>


这篇关于如何在fullcalendar jquery中填写日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆