Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

597
Vistas
How to add a button to each event in fullcalendar v5? I am using listWeek view

Here is what I am trying to achieve

(the button was edited via inspect element by me) I've been trying to implement it by using eventRender without any luck.

<!DOCTYPE html>
<html>
 <head>
  <script src="https://cdn.jsdelivr.net/npm/fullcalendar@5.11.0/main.min.js"></script> </script>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fullcalendar@5.11.0/main.min.css"></script>
 </head>
 <body>
  <div id="calendar"></div>
  <script>
    let calendarEl = document.getElementById('calendar');
    let calendar = new FullCalendar.Calendar(calendarEl, {
      initialView: 'listDay',
      views: {
      listDay: {
        type:'listWeek',
        dayCount:1
        }
      },
      events : [
        {% for appointment in appointments %}
        {
          title : '{{ appointment[2] }}',
          start : '{{ appointment[1] }}',
        },
        {% endfor %}
      ],
      eventRender: function(info) {
      info.el.innerHTML += "<button class='dayButton' data-date='" + info.start + "'>Click me</button>";
      info.el.style.padding = "20px 0 0 10px";
      }
    });
    calendar.render();
  </script>
 </body>
</html>
about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

At the end I solved by doing this :

  eventContent: function (args, createElement)
  {
    const text = args.event._def.title + '<button onclick="alert(\'hello\')" style="float: right"> ciao </button>';
    return {
    html: text
  };
},
about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda