Error: The "field" and "dataSource" options of the scheduler resource are mandatory.

3 posts, 1 answers
  1. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 19 Jul 2013 Link to this post

    I m trying to add resources from the server. Is this possible.
    I tried passing a Ienumerable from the viewmodel to bindto, but got error above.
    I tried using read on resouces , I do not get an error but colors not showing up
    Any example on how to do this? I think I am lost here

    What I have so far.
    @code
        Dim s As Kendo.Mvc.UI.Scheduler(Of BO.Models.Bookings.BookingEvent) = Html.Kendo().Scheduler(Of BO.Models.Bookings.BookingEvent)() _
        .Name("scheduler") _
        .Date(Date.Today) _
        .StartTime(Date.Today.AddHours(7)) _
        .Height(600) _
        .Timezone("America/Phoenix").Resources(Function(resource) resource.Add(Function(m) m.TeamId) _
                                               .Title("Owner") _
                                               .DataTextField("Name") _
                                               .DataValueField("TeamId") _
                                                .DataColorField("Color") _
                                               .DataSource(Function(d) d.Read("resouces", "services", New With {.area = String.Empty}))) _
        .Views(Sub(views)
                       views.DayView()
                       views.WeekView(Function(weekView) weekView.Selected(True))
                       views.MonthView()
                       views.AgendaView()
               End Sub) _
        .DataSource(Function(d) d.Model(Sub(m)
                                                m.Id(Function(f) f.BookingId)
                                                m.Field(Function(f) f.TeamId).DefaultValue(1)
                                        End Sub) _
        .Read("read", "services") _
        .Create("Create", "Scheduler") _
        .Destroy("Destroy", "Scheduler") _
        .Update("Update", "Scheduler"))
     
        s.Render()
    End Code
  2. Answer
    Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 23 Jul 2013 Link to this post

    Hi Alan,

     
    From the provided information it's not clear for us what is the exact reason for this behavior, however for convenience I created small example of using KendoUI Scheduler with VB.NET / Razor and attached it to the current thread - could you please check it and let me know how it differs from your real setup?

    Kind Regards,
    Vladimir Iliev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 23 Jul 2013 Link to this post

    Ok spotted the difference, I did not have JsonRequestBehavior.AllowGet on my resouces  action,
     
    Thanks very much for your time. You guys are great
Back to Top