Hi,
I have a calendar working with mvc3 (razor), I’m using the week view and I have an action that filters the calendar events.
Also, I use my own custom modal windows.
The thing is, it’s working fine in Chrome, but in IE9, everytime I create an event the browser stops responding to javascript.
This is my action:
[code]public ActionResult FilterWeek(WeekMonthEventsViewModel model)
{
var Sched = new DHXScheduler(this);
var vista = Sched.Views[1];
Sched.Views.Clear();
Sched.Views.Add(vista);
Sched.Config.multi_day = false;
Sched.Config.drag_create = false;
if (model.ShowWorkHours)
{
Sched.Config.first_hour = 8;
Sched.Config.last_hour = 18;
}
Sched.XY.scroll_width = 18;
Sched.Config.cascade_event_display = true;
Sched.Config.mark_now = true;
Session[“CalendarModel”] = ParseWeekMonthModelToFilter(model);
Sched.LoadData = true;// allows loading data
Sched.Data.DataProcessor.UpdateFieldsAfterSave = true;
Sched.Calendars.AttachMiniCalendar(true);
Sched.InitialView = “week”;
Sched.Data.EnableDynamicLoading(SchedulerDataLoader.DynamicalLoadingMode.Month);
Sched.EnableDataprocessor = true;// enables DataProcessor in order to enable implementation CRUD operations
String[] userLang = Request.UserLanguages;
if (userLang[0].Contains("es-ES") || userLang[0].Contains("es-AR"))
Sched.Localization.Set(SchedulerLocalization.Localizations.Spanish);
else
Sched.Localization.Set(SchedulerLocalization.Localizations.English);
model.Sched = Sched;
return PartialView("WeekScheduler", model.Sched);
}[/code]
My Data action is like this:
[code]public ContentResult Data()
{
EventFilter model = new EventFilter();
if (Session[“CalendarModel”] != null)
model = (EventFilter)Session[“CalendarModel”];
else
{
model.UsersID = new List();
model.UsersID.Add(SessionContext.Current.UserID);
}
return new SchedulerAjaxData(DataDemand(model));
}
public List DataDemand(EventFilter model)
{
DateTime dateFrom;
DateTime dateTo;
IEventService matterService = ServiceHelper.GetService();
if (Request.QueryString[“from”] != null)
{
dateFrom = DateTime.ParseExact(this.Request.QueryString[“from”], “yyyy-MM-dd”, CultureInfo.InvariantCulture);
dateTo = DateTime.ParseExact(this.Request.QueryString[“to”], “yyyy-MM-dd”, CultureInfo.InvariantCulture);
model.SinceDate = dateFrom;
model.UntilDate = dateTo;
}
List<ThomsonReuters.InfolexWeb.Common.Models.Event> eventos = matterService.GetEvents(model, fillCollections: false);
List<EventItem> items = new List<EventItem>();
foreach (ThomsonReuters.InfolexWeb.Common.Models.Event e in eventos)
{
var item = new EventItem() { ID = e.ID, text = e.Text, start_date = new DateTime(e.Date.Year, e.Date.Month, e.Date.Day, e.StartTime.Value.Hour, e.StartTime.Value.Minute, e.StartTime.Value.Second), end_date = new DateTime(e.Date.Year, e.Date.Month, e.Date.Day, e.EndTime.Value.Hour, e.EndTime.Value.Minute, e.EndTime.Value.Second) };
items.Add(item);
}
return items;
}
[/code]
In Chrome, I can reload the scheduler even after creating an event. But in IE, not only it freezes, the scheduler goes back to a previous version of itself (with deleted events and without the new events).
It seems like I’m doing it wrong. There are a couple of things that concern me…
- Why the “week” view has a from and to of 1 or 2 months?
- How can I update just the event I created or deleted, without refreshing the whole grid?
- Why IE freezes after an update, and why is it bringing old information (it’s not going back to the server)?
- Why does it work in Chrome?
Thanks in advance,
Javier