0

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) }) : []); } 

1 Answer 1

1
  1. Move the call to ko.applyBindings after your declaration of the custom binding
  2. Bring in jqueryUI and it's CSS
  3. daterestriction function is not found

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")); 
Sign up to request clarification or add additional context in comments.

1 Comment

Thanq so much for your reply.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.