шаблон tui-календаря-опция не работает в tui-календаре

#tui-calendar

Вопрос:

HTML

 <head>
    <!-- CALENDAR -->
    <script src="https://uicdn.toast.com/tui.code-snippet/v1.5.2/tui-code-snippet.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.20.1/moment.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/chance/1.0.13/chance.min.js"></script>
    <script src="https://uicdn.toast.com/tui-calendar/latest/tui-calendar.js"></script>

    <!-- APP -->
    <script src="js/app.js"></script>

</head>

<body>
    <div id="calendar"></div>
</body>


 

вот мой app.js

 var _cal
$(document).ready(function() {
    var templates = {
        popupEdit: function() {
            return 'Edit Me';
        },
        popupDelete: function() {
            return 'Delete Me';
        }
    }

    _cal = new tui.Calendar('#calendar', {
        defaultView: 'week',
        taskView: false,
        templates: templates,
        useDetailPopup: true
    });



    //create calendar
    var CalendarList = []
    calendar = new CalendarInfo();

    calendar.id = 1;
    calendar.calendarId = String(1);
    calendar.name = 'Subject';
    calendar.color = 'ffffff';
    calendar.bgColor = '#9e5fff';
    CalendarList.push(calendar);
    _cal.setCalendars(CalendarList)


    //create schedules
    _cal.createSchedules([{
        id: '1',
        calendarId: '1',
        title: 'Termin1',
        category: 'time',
        dueDateClass: '',
        start: '2021-04-06T17:30:00 01:00',
        end: '2021-04-06T19:30:00 01:00',
        isReadOnly: false,
        location: 'here'
    }]);
})
 

Я ожидаю, что заголовок кнопки редактирования во всплывающем окне сведений, которое появляется, когда я нажимаю на встречу, «Отредактируйте меня», но он все еще находится в заголовке по умолчанию «редактировать».

Что я делаю не так?

Есть ли у кого-нибудь опыт работы с календарем тостов?

Ответ №1:

Я нашел свою ошибку:

  _cal = new tui.Calendar('#calendar', {
    defaultView: 'week',
    taskView: false,
    template**s**: templates,
    useDetailPopup: true
});
 

правка:

   _cal = new tui.Calendar('#calendar', {
    defaultView: 'week',
    taskView: false,
    template: templates,
    useDetailPopup: true
});