Muneeb K
Muneeb K

Reputation: 487

How to call another function within events of fullcalendar

I want to call another function , fetchData() , within my eventReceive function, but I keep getting fetchData() is not defined or _this.fetchData() is not function

<FullCalendar
        defaultView="dayGridMonth"
        header={{
          left: "prev,next today",
          center: "title",
          right: "dayGridMonth,timeGridWeek,timeGridDay,listWeek"
        }}
        editable={true}
        droppable={true}
        plugins={[dayGridPlugin, interactionPlugin]}
        events={testSubtask[0] ? testSubtask[0].map(d => ({

               "id": d.id,
               "title": d.name,
               "start": d.start,
               "end": d.end
               })) : null}
        eventReceive={function (info ) {
            this.fetchDraggingTask();  //HOW TO CALL DIFFERENT FUNCTION HERE?  

        }}
 />

Upvotes: 1

Views: 680

Answers (1)

user3431310
user3431310

Reputation: 871

I have been working around with fullcalendar lately. I think this way might work out.

<FullCalendar
    defaultView="dayGridMonth"
    header={{
      left: "prev,next today",
      center: "title",
      right: "dayGridMonth,timeGridWeek,timeGridDay,listWeek"
    }}
    editable={true}
    droppable={true}
    plugins={[dayGridPlugin, interactionPlugin]}
    events={testSubtask[0] ? testSubtask[0].map(d => ({

           "id": d.id,
           "title": d.name,
           "start": d.start,
           "end": d.end
           })) : null}
    eventReceive={(info) => this.fetchDraggingTask(info)}
 />

Upvotes: 2

Related Questions