2016-01-21 97 views
1

我已經添加jQuery 1.11在頁腳與jQuery UI 1.11。還在頭上添加了ui css。現在,日期選擇器的事件不工作jquery datepicker onclose event not firing

$('.datepicker_default').datepicker({ 
     dateFormat: 'dd/mm/yy', 
     onClose: function (dateText, inst) { 
      alert('working'); 
      //$(this).datepicker('option', 'dateFormat', 'dd-mm-yy'); 
     } 
    }); 

HTML

<input type="text" class="form-control datepicker_default" placeholder="dd/mm/yyyy" name="datepicker"> 

這裏是頭部和頁腳 https://gist.github.com/anonymous/9a6ed80380612e5cfb82

+1

你在控制檯中得到錯誤? – guradio

+0

@guradio沒有錯誤。有錯誤,但與其他插件。即使嘗試刪除這些插件仍然無法正常工作 –

+1

@OP,它在這裏工作:http://jsfiddle.net/rayon_1990/8w8v9/945/可能是你正面臨版本相關的問題.. – Rayon

回答

0

我認爲是自舉日期選擇器和jQuery-UI的日期選擇器

之間的conflic
<script type="text/javascript" src="<?php echo base_url('assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js'); ?>"></script> 

bootstrap-datepicker和jquer y-ui-datepicker有相同的

$(「#div」).datepicker();

http://www.eyecon.ro/bootstrap-datepicker/

+0

歡迎您! – Osgux