jQuery UI datepicker change event not caught by KnockoutJS

后端 未结 13 2406
长发绾君心
长发绾君心 2020-11-22 16:16

I\'m trying to use KnockoutJS with jQuery UI. I have an input element with a datepicker attached. I\'m currently running knockout.debug.1.2.1.js and it seems th

13条回答
  •  长发绾君心
    2020-11-22 16:41

    I've used a different approach. Since knockout.js doesn't seem to fire the event on change, I've forced the datepicker to call change() for its input once closed.

    $(".date").datepicker({
        onClose: function() {
            $(this).change(); // Forces re-validation
        }
    });
    

提交回复
热议问题