This is a migrated thread and some comments may be shown as answers.

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

2 Answers 508 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Gerd
Top achievements
Rank 1
Gerd asked on 21 Jan 2014, 08:39 AM
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();
03. 
04.function SchedulerAdditionalData() {
05.    return { mitarbeiterId: initialMitarbeiterId, filterKategorien: filterKategorieArray.toString() };
06.}
07. 
08.function SchedulerReadData() {
09.    var scheduler = $("#ErfassungScheduler").data("kendoScheduler");
10.    scheduler.dataSource.read();
11.}
the Scheduler code in razor Logik Looks like this:

01.@(Html.Kendo().Scheduler<Sachverhalt>()
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));
10. 
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

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

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 Answers, 1 is accepted

Sort by
0
Sandro
Top achievements
Rank 1
answered on 15 Apr 2014, 05:38 PM
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 ...
0
Daniel
Telerik team
answered on 17 Apr 2014, 12:28 PM
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.

Regards,
Daniel
Telerik
 

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.

 
Tags
Scheduler
Asked by
Gerd
Top achievements
Rank 1
Answers by
Sandro
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or