Datasource.Read("Action", "Controller").Data("AdditionalParams") is not working after Update to Kendo UI for ASP.NET MVC Q3 2013

3 posts, 1 answers
  1. Answer
    Gerd avatar
    1 posts
    Member since:
    Aug 2013

    Posted 21 Jan 2014 Link to this post

    This bug is fixed with the internal build: kendoui.aspnetmvc.internal.2013.3.1321.commercial !

    Hi kendo support team,

    i have updated my Kendo Version yesterday to the new "Kendo UI for ASP.NET MVC Q3 2013" Release.

    Now my Scheduler works with additional parameters they will calculate on runtime.
    The user click some btns and the Scheduler refresh the data by call JavaScript method read()

    like this:
    01.var initialMitarbeiterId =5;
    02.var filterKategorieArray = new Array();
    04.function SchedulerAdditionalData() {
    05.    return { mitarbeiterId: initialMitarbeiterId, filterKategorien: filterKategorieArray.toString() };
    08.function SchedulerReadData() {
    09.    var scheduler = $("#ErfassungScheduler").data("kendoScheduler");
    the Scheduler code in razor Logik Looks like this:

    02.          .Name("ErfassungScheduler")
    03.          .Date(DateTime.Now)
    04.          .Views(views =>
    05.          {
    06.              views.DayView(oDayView => oDayView.DateHeaderTemplate("#=kendo.toString(date, 'ddd dd. MM.')#").Selected(false));
    07.              views.WeekView(oWeekView => oWeekView.DateHeaderTemplate("#=kendo.toString(date, 'ddd dd. MM.')#").Selected(false));
    08.              views.MonthView(oMonthView => oMonthView.Selected(true));
    09.              views.AgendaView(oAgendaView => oAgendaView.Selected(false));
    11.          })
    12.          .Selectable(true)
    13.          .Timezone(timezoneString)
    14.          .DataSource(oDs => oDs.Model(m =>
    15.              {
    16.                  m.Id(f => f.Id);
    17.                  m.Field(f => f.IsAllDay);
    18.                  m.Field(f => f.Title).DefaultValue("Neuer Termin");
    19.                  m.Field(f => f.SachverhaltKategorieId);
    20.                  m.Field(f => f.SachverhaltTypId);
    21.              })
    22.             .Read( r => r.Action("SchedulerRead", "Erfassung").Data("SchedulerAdditionalData"))
    23.        .Destroy("SchedulerDestroy", "Erfassung")
    24.             )
    25.          .Events(e => e.Edit("scheduler_edit").Add("scheduler_add").Navigate("scheduler_navigate"))
    26.          .Resources(resource =>
    27.              resource.Add(m => m.SachverhaltKategorieId)
    28.                .Title("Kategorie")
    29.                .DataTextField("Text")
    30.                .DataValueField("Value")
    31.                .DataColorField("Color")
    32.                .BindTo(colorResourceList)
    33.          )
    34.          .ShowWorkHours(true)
    35. )

    The Controller Methode

    2.public JsonResult SchedulerRead([DataSourceRequest] DataSourceRequest oRequest, long mitarbeiterId, string filterKategorien)
    4.            var selectedMitarbeiterId = mitarbeiterId;
    5.            return Json(this.sachverhaltBL.LoadSachverhalte(selectedMitarbeiterId, filterKategorien).ToDataSourceResult(oRequest));

    This line .Read( r => r.Action("SchedulerRead", "Erfassung").Data("SchedulerAdditionalData")) works fine with the previous Version. The JavaScript function "SchedulerAdditionalData" is called before post to Controller, but the Controller throws a http Status 500 because mitarbeiterId is null. In the previus Version it works correct, Did Kendo have Changed something in this Version. The release notes don't talk about this Problem.

    If i change the JavaScript file "kendo.aspnetmvc.min.js" to the privious Version only, this Scenario works fine! I think there is a new bug in the js libraray.

    Best regards

    Gerd Kontze

  2. Sandro
    Sandro avatar
    2 posts
    Member since:
    Aug 2008

    Posted 15 Apr 2014 in reply to Gerd Link to this post

    We are experiencing a similar problem but only from time to time - sometimes the "data"-function is never called thus the additional supplied data is always null and we get an internal server error 500. I'm currently debugging such a case and I can tell you it is really frustrating ...
  3. Daniel
    Daniel avatar
    2231 posts

    Posted 17 Apr 2014 Link to this post

    Hello Sandro,

    Could you provide a sample project that reproduces the problem with the additional data function not being called? The issue described here was caused by the additional data not being included in the request data in the  Q3 2013 release but the function was still called.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top