Kendo Datetime picker doesn't pass the model values

2 posts, 0 answers
  1. Anshita
    Anshita avatar
    4 posts
    Member since:
    Jan 2014

    Posted 14 Oct 2014 Link to this post


    I am using Kendodatetimepicker inside knockoutJS foreach loop. I need to pass the model or the datetimepicker current value with name or index on its change event. This scenario works with non kendo controls. In my code I need to pass testParameters or just the current row value of kendo datetimepicker from

    part of my code is -

    <table width="500" cellpadding="5" cellspacing="5">

    <tbody data-bind="foreach: testParameters">
    <!-- ko if: isDateTime-->

    @*<input class="" type="text" data-bind="kendoDatePicker: {value:Datevalue, start: 'decade', depth: 'decade', format: 'yyyy', culture: Ion.options.culture, min: new Date(@DateTime.Now.AddYears(-10).Year, 0, 1), max: new Date(@DateTime.Now.AddYears(10).Year, 0, 1) }" />*@
    <input class="" type="text" data-bind="kendoDatePicker:{value:DateValue , format: 'dd/MM/yyyy' , change:function(){$parent.searchParameters($data);} , id:Name}">

    function ReportParameterViewModel() {
    var self = this;

    self.testParameters = ko.observableArray([]);

    self.searchParameters = function (reportParameter) {

    ///do something
  2. Anshita
    Anshita avatar
    4 posts
    Member since:
    Jan 2014

    Posted 15 Oct 2014 in reply to Anshita Link to this post

    Problem is fixed by changing change:function(){$parent.searchParameters($data);} to close:function(){$parent.searchParameters($data);}
    and by adding subscribe function
    this.DateValue.subscribe(function (val) {
                }, this);
Back to Top