我使用的是rpn (http://www.knockmeout.net/2011/07/another-look-at-custom-bindings-for.html)提供的datepicker绑定。在集成beforeShowDay事件时,我遇到了一些困难。
我想突出显示日历中的日期,所以我添加了
beforeShowDay: function (currentDay) { //logic if currentDay is within observableArray then highlight };但该逻辑依赖于来自ajax调用的数据(observableArray)。
当beforeShowDay函数中使用的observableArray更新时,我如何告诉datepicker更新其突出显示的日期?
发布于 2012-07-26 16:47:11
订阅您的observableArray更改,并在事件函数中刷新datepicker以重新呈现其内容。
self.YourArray.subscribe(function (newValue) {
// re-init or re-render datepicker
});https://stackoverflow.com/questions/11664636
复制相似问题