0

I've got a Kendo Ui datetimepicker. But when I choose time or date, there is an error "Cannot call method 'attr' of undefined", that appears in kendo.all.min.js. What might be the issue?

Honestly, i've got Kendo Scheduler. But when i try to create an event, there are datetimepickers, and when i choose date or time i've got such kind of error. Here's my code:

@{
    var culture = System.Threading.Thread.CurrentThread.CurrentCulture.ToString();
}
<script src="@Url.Content("~/Scripts/kendo/jquery.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/kendo.all.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/kendo.aspnetmvc.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/cultures/kendo.culture." + culture + ".min.js")"></script>
<script>
    kendo.culture("@culture");
</script>
@using Kendo.Mvc.UI
@(Html.Kendo().Scheduler<TaskViewModel>()
    .Name("scheduler")
    .Date(DateTime.UtcNow)
    .StartTime(DateTime.UtcNow)
    .Height(600)
    .Width(1000)
    .Timezone("Etc/UTC")
    .Views(views =>
    {
        views.DayView();
        views.WeekView(weekView => weekView.Selected(true));
        views.MonthView();
        views.AgendaView();
    })

    .DataSource(d => d
        .Model(m => {
            m.Id(f => f.TaskID);
        })
        .Read("Read", "TaskManager")
        .Create("Create", "TaskManager")
        .Destroy("Destroy", "TaskManager")
        .Update("Update", "TaskManager")
    )
      )

i'm using ru-Ru culture.

  • you need to add your code to reproduce the issue – Lars Höppner Jan 10 '14 at 12:29
  • might be a browser based issue. sometimes instead of the `JQuery` method `attr()`(for getting attributes) `prop()`(for getting properties) is used. [Here](http://stackoverflow.com/questions/5874652/prop-vs-attr) is a link which mentions about this – Squirrel5853 Jan 10 '14 at 12:34

1 Answers1

0

Does your declaration/include of scripts looks something like this:

<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://cdn.kendostatic.com/2013.3.1119/js/kendo.all.min.js"></script>

...

JQuery should be declared first and along with your Kendo scripts.

The second posible cause is your JQuery selector. Try something simple and setting both name and id attributes like:

$("#ctrl")

Josh Crozier
  • 233,099
  • 56
  • 391
  • 304
Dalorzo
  • 19,834
  • 7
  • 55
  • 102