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

    Hi,

    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
    change:function(){$parent.searchParameters($data);}

    part of my code is -

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

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

    @*<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}">
    </td>
    </tr>
    </tbody>
    </table>

    function ReportParameterViewModel() {
    var self = this;

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

    self.searchParameters = function (reportParameter) {

    ///do something
    }
    }
    Thanks.
  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);
  3. Kendo UI is VS 2017 Ready
Back to Top