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

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

2 Answers 333 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Alan Mosley
Top achievements
Rank 1
Alan Mosley asked on 19 Jul 2013, 08:14 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir Iliev
Telerik team
answered on 23 Jul 2013, 08:18 AM
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!
0
Alan Mosley
Top achievements
Rank 1
answered on 23 Jul 2013, 11:10 AM
Ok spotted the difference, I did not have JsonRequestBehavior.AllowGet on my resouces  action,
 
Thanks very much for your time. You guys are great
Tags
Scheduler
Asked by
Alan Mosley
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Alan Mosley
Top achievements
Rank 1
Share this question
or