This is a migrated thread and some comments may be shown as answers.
Uncaught TypeError: Cannot read property 'replace' of null
2 Answers 123 Views
This is a migrated thread and some comments may be shown as answers.
rakesh
Top achievements
Rank 1
rakesh asked on 26 Oct 2017, 07:33 AM

Hello,

I have a scheduler defined like this:

@(Html.Kendo().Scheduler<SignalR.Web.Models.EventInput>()
    .Name("scheduler")
    .Date(DateTime.Now)
    .StartTime(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day))
    .Views(views =>
    {
        views.DayView();
        views.WorkWeekView(workWeekView => workWeekView.Selected(true));
        views.WeekView();
        views.MonthView();
        views.AgendaView();
        views.TimelineView();
    })
    .DataSource(d => d
        .Model(m =>
        {
            m.Id(f => f.Id);
            m.Field(f => f.Title);
            m.Field(f => f.Start);
            m.Field(f => f.End);
            m.Field(f => f.Description);
        })
        .Read("Read", "Scheduler")
        .Create("Create", "Scheduler")
        .Destroy("Destroy", "Scheduler")
        .Update("Update", "Scheduler")

    )
)

 

When I load my page, my data loads on the scheduler but I get this error on console:

Uncaught TypeError: Cannot read property 'replace' of null
    at Object.eval [as tmpl0] (eval at compile (kendo.all.js:194), <anonymous>:3:152)
    at Object.eval (eval at compile (kendo.all.js:194), <anonymous>:3:645)
    at d (jquery.min.js:2)
    at r._createEventElement (kendo.all.js:91346)
    at r._renderEvents (kendo.all.js:91436)
    at render (kendo.all.js:91504)
    at init.refresh (kendo.all.js:100801)
    at init.d (jquery.min.js:2)
    at init.trigger (kendo.all.js:124)
    at init._process (kendo.all.js:7050)

Then when I click on the scheduler to add a new task on tabs "Work Week", "Week", "Month", no popup to add new Task is displayed.

2 Answers, 1 is accepted

Sort by
0
Tyler
Top achievements
Rank 1
answered on 26 Oct 2017, 07:41 PM

Are you able to provide a runnable example? I am not familiar with SignalR and don't know how to get your scheduler running in a dojo. 

 

The reason no pop up shows up to make a new task is because your scheduler already crashed. The Uncaught TypeError has broken your scheduler, so now things may behave with undefined behavior, or not function at all. 

0
Joana
Telerik team
answered on 27 Oct 2017, 01:46 PM
Hi all,

Here you could find an example of the Scheduler usage with SignalR:

https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/scheduler/scheduler-signalr-local-hub-locking-events

In addition, here are our demos on the topic for the jquery widget and the MVC wrapper:

https://demos.telerik.com/kendo-ui/scheduler/signalr

https://demos.telerik.com/aspnet-mvc/scheduler/signalr


Regarding the Cannot read property 'replace' of null error, everything seems to work as expected on my end. You could send a support ticket with attached sample project, so that we could investigate what's causing the error.

Regards,
Joana
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Asked by
rakesh
Top achievements
Rank 1
Answers by
Tyler
Top achievements
Rank 1
Joana
Telerik team
Share this question
or