-2
color I can, but I need to color when selecting the seller X, How to color different Events in fullcalendar? based on an option... example: I have 3 sellers, I want each Seller to have its own color when clicking on the day to register an event, this he chooses through a modal. This modal is the Event registration screen, where the seller chooses the Title, the Seller’s name, the initial date and the final date.... when choosing the seller A the color in fullcalendar should be red, when choosing Seller B the color should be blue and when choosing Seller C the color should be green... thanks in advance...
<label for="inputEmail3" class="col-sm-2 control-label">Salesman</label>
<div class="col-sm-10">
<select name="color" class="form-control" id="color">
<option style="color:#FFD700;" value="#FFD700">ERICK</option>
<option style="color:#0071c5;" value="#0071c5">MATHEUS</option>
<option style="color:#FF4500;" value="#FF4500">JÉSSICA</option>
</select>
</div>
<div class="modal-body">
<dl class="dl-horizontal">
<dt>ID do Evento</dt>
<dd id="id"></dd>
<dt>Titulo do Evento</dt>
<dd id="title"></dd>
<dt>Vendedor</dt>
<dd id="color"></dd>
<dt>Inicio do Evento</dt>
<dd id="start"></dd>
<dt>Fim do Evento</dt>
<dd id="end"></dd>
</dl>
</div>
eventClick: function(event) {
$('#visualizar #id').text(event.id);
$('#visualizar #title').text(event.title);
$('#visualizar #color').text(event.color);
//$('#visualizar #vend').text(event.vend);
$('#visualizar #start').text(event.start.format('DD/MM/YYYY HH:mm:ss'));
$('#visualizar #end').text(event.end.format('DD/MM/YYYY HH:mm:ss'));
$('#visualizar').modal('show');
return false; },
Show your code.
– Netinho Santos
HERE THE USER CHOOSES THE SELLER, so far so good, the event goes pro calendar in the specified color <div class="form-group"> <label for="inputEmail3" class="col-Sm-2 control-label">Seller</label> <div class="col-Sm-10"> <select name="color" class="form-control" id="color"> <option value="">Select</option> <option style="color:#0071c5;" value="#0071c5">ERICK</option> <option style="color:#FF4500;" value="#FF4500">JÉSSICA</option> <option style="color:#8B4513;" value="#8B4513">MATHEUS</option> </select>
– The Lélis Designer
HERE IS THE EVENT, which pulls in the BD: Events: [ <? php while($row_events = mysqli_fetch_array($resultado_events)){ ? > { id: '<? php echo $row_events['id']; ? >', title: '<? php echo $row_events['title']; >', start: '<? php echo $row_events['start']; ? >', end: '<? php echo $row_events['end']; ? >', color: '<? php echo $row_events['color']; ? >', },<? php } ? > ]
– The Lélis Designer
THIS IS WHERE THE EVENT IS SHOWN in a modal, and here is the problem, it does not show the Seller, if I put it to show the Seller, it stops coloring.:
– The Lélis Designer
$('#visualize #id'). text(Event.id); $('#visualize #id'). val(Event.id); $('#visualize #title'). val(Event.title); $('#display #start'). val(Event.start.format('DD/MM/YYYY HH:mm:ss'); $('#visualize $('#visualize #end'). val(Event.end.format('DD/MM/YYYY HH:mm:ss'); $('#visualize #color'). val(Event.color); //$('#visualize #color'). text(Event.color); $('#visualize'). modal('show');
– The Lélis Designer
AND HERE IS THE MODAL WHERE THE EVENT SHOWS: <div class="view"> <dl class="dl-horizontal"> <dt>ID</dt> <dd id="id"></dd> <dt>Customer</dt> <dd id="title"></dd> <dt>Seller</dt> <dd id="color"></dd> <dt>Expected start</dt> <dd id="start"></dd> <dt>Intended end</dt> <dd id="end"></dd> </dl> <button class="btn btn-canc-vis btn-Warning">Edit</button> </div>
– The Lélis Designer
@Netinhosantos there are my codes.
– The Lélis Designer
Enter your code into the question. It’s easier to read
– Netinho Santos
@Netinhosantos put in question the code.
– The Lélis Designer
@André Baill , can help me,?
– The Lélis Designer
@Felipe Miranda de Lima
– The Lélis Designer
I don’t know if it’s exactly what you want, but here’s an example: http://jsbin.com/cuninamula/edit?html,output . Only I could not put here in Stack, it did not load the lib of Fullcalendar :( If it is, I can put the code in the answer.
– Netinho Santos