1
- 我有一個按鈕,當我點擊按鈕時,我想相應地重裝DatePicker並從我的click事件中啓動datePicker的beforeShowDay事件。
我該怎麼做? 如何將DatePicker日期設置爲ListDate [0]日期?如何調用OnChange DatePicker事件
var ListDate = new Array(); var ID; $(function() { $("#myDateDiv").datepicker({ showOtherMonths: true, selectOtherMonths: true, dateFormat: "yy/mm/dd", onSelect: function (dateText, inst) { // }, onChangeMonthYear: function(year, month, inst) { }, beforeShowDay: function(dateToShow) { testFunction(dateToShow, ID); ListDate = getListdateFuction(); ///How to set the datePicker date to ListDate[0] }); }); });
$("test").click(function(){ How to call datePicker berforeShowDay or onChange function ??? });
設置的onChangeMonthYear將被觸發日期很簡單,但我寧願啓動ONC hnage功能。如何在上面的代碼中設置日期? – learning 2011-05-04 12:34:19
@ user281180請參閱編輯 – mcgrailm 2011-05-04 13:02:06
謝謝,我想在beforeShowDay事件中設置datePicker ... – learning 2011-05-04 13:09:15