I have got this templated knockout-loop:
<div id="accordion" data-bind="jqAccordion:{},template: {name: 'task-template',foreach: Tasks,afteradd: function(elem){$(elem).trigger('valueChanged');}}">. </div>
<script type="text/html" id="task-template">
<div data-bind="attr: {'id': 'Task' + TaskId}" class="group">
<h3><b><input name="TaskName" data-bind="value: TaskName /></b></h3>
<p>
Due Date: <input class="datepicker" data-bind="myDatepicker : {}, value: taskDueDate" />
</p>
</div>
</script>
Where datepicker is a jQuery Ui datepicker function:
ko.bindinghandler.myDatepicker = $(function() {
init: function( element, valueAccessor) {
$(element).datepicker({
changeMonth: true,
changeYear: true
});
}),
etc.
}
why does this not work?
Symptoms are: the calender is showing and the widget respond to my interactions but no date is returned to the input-field. Any clues?
Thank you in advance!