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

258
Visualizações
Full calendar v3 Specific event disable dragging

I'm trying to do if the event of reservations changes color and you can't drag it, I looked in Google for nothing, I decided to write to Stack support. Stuck on this task thanks for any help and support. Im use (v3 full calendar)

Color changes its okey, but can dragging,

                // Event render
                eventRender: function(event, element) {
                    if (event.status == 'reserved') {
                       // Here im try disable dragging
                        event.editable = false;
                        element.css({
                            'background': 'lemonchiffon',
                        });
                    }else if(event.status == 'available'){
                        element.css({
                            'background': 'lightgreen',
                        });
                    }

                    if(event.gap_beetween_slot === '0'){
                        $(element).find('.fc-resizer').remove();
                    }
                    $(element).find('.fc-title').html(event.title);

                }

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

As you seem to have realised already, if you set an event's editable property to false, it will prevent it from being dragged.

Documentation:

  • https://fullcalendar.io/docs/v3/event-object
  • https://fullcalendar.io/docs/v3/editable

However the problem is that you're setting the field during the eventRender callback. At that moment it's too late, because fullCalendar has already created the HTML of the event from the event's properties. It does not read from them any more after this point. eventRender is simply your chance to make further changes to the HTML. Any changes you make to the event's properties are ignored.

Therefore you need to make this change earlier in the process. I think you probably have a couple of options:

  1. If you're generating these events in your server-side code (e.g. from a list in a database, perhaps) then you could set the editable property before you transform the data to JSON and return it to fullCalendar.

  2. If that isn't possible for any reason, then fullCalendar offers the eventDataTransform callback which allows you to modify an event's properties before it is rendered to HTML. For example:

eventDataTransform: function(event) {
  if (event.status == 'reserved') {
    event.editable = false;
  }
  return event;
}

Documentation: https://fullcalendar.io/docs/v3/eventDataTransform

about 4 years ago · Juan Pablo Isaza 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