1
我使用的是標準的jQuery Datepicker,我需要修改它以在底部顯示圖例。當我使用beforeShow事件時,我不能將圖例html附加到datepicker,因爲沒有#ui-datepicker-div元素,並且datepicker不提供afterShow事件。這是我的代碼:將傳說添加到jQuery datepicker
var html = $('#datepickerLegendHolder').html();
$('#start_date.datepicker').datepicker({
"dateFormat": 'yy-mm-dd',
minDate: 0,
showOn: "both",
buttonImage: "/images/calendar-icon.png",
maxDate: "+2Y",
beforeShow: function(event, ui) {
$('#ui-datepicker-div').append(html);
},
onSelect: function (dateValue, inst) {
$('#end_date.datepicker').datepicker("option", "minDate", dateValue);
displayButtons();
}
});
有沒有人可以選擇? Tnx
其實,我試圖與超時()函數,但使用創建事件,以及較小的超時時間,並沒有奏效。無論如何,它不會減少你的幫助:) Tnx! – dzona 2012-03-23 15:50:14
不幸的是,jQuery UI的文檔非常糟糕IMO。 「創建」事件僅對使用Widget Factory的窗口小部件存在,並且日期選擇器尚未實現它(尚)。無論如何,很高興它幫助! – 2012-03-23 15:52:56