I'm attempting to create a custom knockoutJS binding with the jquery-ui Datepicker like this: http://jsfiddle.net/rniemeyer/X82aC/ jQuery UI datepicker change event not caught by KnockoutJS
I'm having no luck after implementing requireJS though, which I tried modeling after both examples in this documentation: (currently using the latter of the examples) http://knockoutjs.com/documentation/amd-loading.html
There are no errors, however my observable Dates are not being updated after the Datepicker selection is made. Here's a live URL example (try the 'Start Date' input at the top left corner) : http://www.nealgist.com/stackoverflow/reporting_0_4_3
define(['plugins/knockout','datepicker'], function(ko) {
return function appViewModel(){
...
this.startDate = ko.observable(new Date());
}
}
define(['plugins/knockout'], function(ko) {
ko.bindingHandlers.datePicker = { ... }
}
index.html:
<input type="text" data-bind="datepicker:$root.startDate" />
I could really use some help if you have any ideas, thank you in advance!!