Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

598
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda