我想从我尝试过的 eventRender 函数回调中调用 handleContextEdit 方法 this.handleContextEdit(event); 但它不工作。请帮帮我。
export default class FullCalendarJs extends LightningElement {
initialiseFullCalendarJs() {
const ele = this.template.querySelector('div.fullcalendarjs');
$(ele).fullCalendar({
// this.calendar = new FullCalendar.Calendar(ele,{
header: {
left: 'prev,next, today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
//themeSystem:'bootstrap3',
plugins: [ 'momentTimezone' ],
defaultDate: moment(),
navLinks: true, // can click day/week names to navigate views
editable: true,
eventLimit: true, // allow "more" link when too many events
events: this.programEventList,
eventRender:function(event, element){
var originalClass = element[0].className;
element[0].className = originalClass + ' hasmenu';
$(ele).contextMenu({
selector: '.hasmenu',
callback: function(key, options,e) {
this.handleContextEdit(event); //this is undefined here
},
items: {
"view": {name: "View", icon: "view"},
"edit": {name: "Edit", icon: "edit"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function(){
return 'context-menu-icon context-menu-icon-quit';
}}
}
});
}
});
$(ele).fullCalendar('render');
}
handleContextEdit(event){
console.log(event);
}
}
我想从我尝试过的 eventRender 函数回调中调用 handleContextEdit 方法 this.handleContextEdit(event); 但它不工作。请帮帮我。谢谢!!