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

Kendo UI scheduler error in event Image

2 Answers 168 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lilan
Top achievements
Rank 2
Lilan asked on 01 Jun 2015, 09:51 AM

Hi, 

I have added image property to the event and change the event template to show image in the event. please check demo application. when i double click on the event, it will open edit event popup without an issue. but if I double click on empty area to add a new event, console shows following error and events will be disappeared.  

Uncaught ReferenceError: image is not defined

Any idea? 

Regards, 

Lilan

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 03 Jun 2015, 06:47 AM

Hello Lilan,

The error is caused by the fact that image field does not exist when creating new event. In order to handle this you could modify the template to check if the image is present and only then display it:

eventTemplate: "<div class='k-event-template'>#if (data.image) {# <img src='#= image #'>#}# #= title #</div>",

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Lilan
Top achievements
Rank 2
answered on 03 Jun 2015, 06:55 AM

Hello Rosen, 

 Thanks a lot and it solved my issue. 

 Regards, 

Lilan

Tags
General Discussions
Asked by
Lilan
Top achievements
Rank 2
Answers by
Rosen
Telerik team
Lilan
Top achievements
Rank 2
Share this question
or