Datepicker is shown behind the modal bootstrap

Asked

Viewed 1,690 times

3

I have a modal in bootstrap:

<!-- Modal content-->
<div class="modal-content">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal">&times;</button>
    <h4 class="modal-title">Agendar reunião do evento <?php echo $row- >denominacao; ?></h4>
  </div>
  <div class="modal-body">
    <div class="box">
      <div class="box-body">
        <?php echo form_open('utilizador/alterarAgendamento'); ?>
          <div class="row">
            <div class="form-group col-xs-6">
              <label>Data</label>
              <div class="input-group">
                <div class="input-group-addon">
                  <i class="fa fa-calendar"></i>
                </div>
                <input type="hidden" value="<?php echo $row->idevento; ?>" name="idevento" />
                <input type="text" class="form-control data_inserir" readonly="readonly" name="data" />
              </div>
            </div>
            <div class="form-group col-xs-6 bootstrap-timepicker">
              <label>Hora</label>
              <div class="input-group">
                <input type="text" class="form-control timepicker" name="hora" />
                <div class="input-group-addon">
                  <i class="fa fa-clock-o"></i>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="form-group col-xs-12">
              <label>Notas</label>
              <textarea class="form-control" rows="3" name="nota" placeholder=""> </textarea>
            </div>
          </div>
          <button type="submit" class="form-control">Re-Agendar</button>
          <?php echo form_close(); ?>
      </div>
    </div>
  </div>
</div>

Input with the class data_inserir is calling the dataPicker function, but this one appears behind the modal and I can’t get it to stay ahead.

inserir a descrição da imagem aqui

1 answer

2

This is usually a problem with the z-index, try adding a value of z-index higher in its Datepicker display class as for example:

.suaClassDatePicker {
    z-index: 100000;
}
  • already tried, I’ve even changed the code of . js with the version that says it is fixed but does not work :/

  • Which Voce datepicker is using ? The jquery-ui?

  • hello, this is, https://github.com/eternicode/bootstrap-datepicker/

  • 1

    @Orangemechanic, friend of a look at this jsfiddle, on it I am forcing the z-index. If by chance it does not work in your application, I suggest updating the library to newer version. test and give me a feedback here :)

  • 2

    Brunno, Thank you, with the . datepicker did not work, but I changed the css .datepicker.dropdown-menu {z-index:1000;} to .datepicker.dropdown-menu {z-index:10000;} and it’s worked thanks

  • @Orangemechanical, cool anything just call :)

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.