Reputation: 139
This is my fiddle. http://jsfiddle.net/aaScC/4/
In the example, for the StartDate property custom binding handler is created to get jquery datepicker. But its not working please help.
var Goal = function(goal)
{
this.GoalTitle = ko.observable(goal?goal.GoalTitle:"");
this.StartDate = ko.observable(goal?goal.StartDate:"");
this.lstSubGoals = ko.observableArray(goal ? ko.utils.arrayMap(goal.lstSubGoals, function (goal) { return new Goal(goal) }) : []);
}
Upvotes: 0
Views: 855
Reputation: 7194
Working fiddle: http://jsfiddle.net/aaScC/5/
--
ko.bindingHandlers.datepicker = {
init: function (element, valueAccessor, allBindingsAccessor) {
...
},
update: function (element, valueAccessor) {
...
}
};
ko.applyBindings(new GoalsModel(data), document.getElementById("goaldetailsdiv"));
Upvotes: 1