[CLOSED] CalendarPanel Remote Data

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] CalendarPanel Remote Data

    Hi,

    I have the following code to load the Events of the Calendar from the server side. For some reason, the events do not show on the calendar at all. Any help is appreciated.

    View:
    Html.X().CalendarPanel().Region(Region.Center).ActiveIndex(2).Border(false).CalendarStore(Html.X().CalendarStore().Calendars(calendars =>
                    {
                        calendars.Add(new CalendarModel() { CalendarId = 1, Title = "Home"});
                        calendars.Add(new CalendarModel() { CalendarId = 2, Title = "Work" });
                        calendars.Add(new CalendarModel() { CalendarId = 3, Title = "School" });
                    })).EventStore(Html.X().EventStore().Proxy(proxy => proxy.Add(Html.X().AjaxProxy().Url(Url.Action("GetEvents")).Json(true).Reader(reader => reader.Add(Html.X().JsonReader().Root("data"))))))
    Action:
    public JsonResult GetEvents()
            {
                var data = new EventModelCollection();
                
                data.Add(new EventModel()
                    {
                        EventId = 1001,
                        CalendarId = 1,
                        Title = "Vocation",
                        StartDate = DateTime.Now.AddDays(-20).AddHours(10),
                        EndDate = DateTime.Now.AddDays(-10).AddHours(15),
                        IsAllDay = false,
                        Notes = "Have Fun"
                    });
                data.Add(new EventModel()
                {
                    EventId = 1002,
                    CalendarId = 2,
                    Title = "Lunch with Matt",
                    StartDate = DateTime.Now.AddHours(11).AddMinutes(30),
                    EndDate = DateTime.Now.AddHours(13),
                    IsAllDay = false,
                    Location = "Chuy's!",
                    Url = "http://chuys.com",
                    Notes = "Order the queso",
                    Reminder = "15"
                });
                data.Add(new EventModel()
                {
                    EventId = 1003,
                    CalendarId = 3,
                    Title = "Project Due",
                    StartDate = DateTime.Now.AddHours(15),
                    EndDate = DateTime.Now.AddHours(15),
                    IsAllDay = false
                });
    
                return Json(data);
            }
    Last edited by Daniil; May 18, 2012 at 5:01 PM. Reason: [CLOSED]

Similar Threads

  1. How to reload CalendarPanel Data of Code-Behind?
    By easypower in forum 1.x Help
    Replies: 0
    Last Post: Jun 11, 2012, 3:37 AM
  2. datecolumn don't work with remote data
    By PetrSnobelt in forum 1.x Help
    Replies: 6
    Last Post: Jun 08, 2011, 10:25 AM
  3. [CLOSED] Local Paging for Remote Data Issue
    By dnguyen in forum 1.x Legacy Premium Help
    Replies: 26
    Last Post: Apr 12, 2011, 12:50 AM
  4. How to dispaly the Data using calendarpanel
    By krishna in forum 1.x Help
    Replies: 1
    Last Post: Jan 11, 2011, 1:16 PM
  5. [CLOSED] [1.0] Gridview local data paging with remote data
    By BerndDA in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 15, 2010, 10:29 AM

Posting Permissions