Knockout js: el controlador de enlace del selector de fecha no funciona

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

}

preguntado el 08 de febrero de 14 a las 14:02

1 Respuestas

  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

Violín de trabajo: 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"));

Respondido 08 Feb 14, 14:02

Thanq so much for your reply. - dineshd87

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.