JQuery Datepicker, can't trigger onSelect event manually!

前端 未结 9 1070
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-05 00:00

I am using jquery\'s datepicker where a list of items is populated from an ajax call whenever a date is picked from an inline datepicker object. The script works perfect exc

9条回答
  •  我在风中等你
    2021-01-05 00:28

    Here is what I came up with and seems to be the best solution:

    var inst = $.datepicker._getInst($("#date")[0]);
    $.datepicker._get(inst, 'onSelect').apply(inst.input[0], [$("#date").datepicker('getDate'), inst]);
    

    And it works like a charm

提交回复
热议问题