Search code examples
kendo-uikendo-scheduler

Kendo UI scheduler error in event Image


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


Solution

  • I have found the solution 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>",
    

    Thanks,

    Lilan