2016-05-08 27 views

回答

0

您不能將jQueryUI datepicker應用到w2ui日期字段,因爲沒有辦法阻止打開w2ui日期彈出窗口。

但是,您可以將jQueryUI datepicker應用到「正常」w2ui字段,以便您可以在該字段上使用w2ui外觀,並使用datepicker。

注意,使用w2ui佈局/表格時,你很可能已經使用的z-index,無論你想與否,而jQueryUI的的日期選擇器有2

默認的z-index爲了規避這個,你可以按如下方法設置的z-index:

<p>Date: <input type="text" id="datepicker"></p> 
<script> 
$(function() { 
    $("#datepicker").datepicker({ 
     beforeShow: function() { 
      setTimeout(function(){ 
       $('.ui-datepicker').css('z-index', 99999999999999); 
      }, 0); 
     } 
    }).w2field('text'); 
}); 
</script> 

或者你也可以寫,打開一個jQueryUI的日期選擇自己w2ui領域:

http://w2ui.com/web/docs/form/fields-custom

相關問題