This is a migrated thread and some comments may be shown as answers.

Kendo Datetime picker doesn't pass the model values

1 Answer 124 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Anshita
Top achievements
Rank 1
Anshita asked on 14 Oct 2014, 10:07 AM
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.

1 Answer, 1 is accepted

Sort by
0
Anshita
Top achievements
Rank 1
answered on 15 Oct 2014, 01:03 PM
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);
Tags
Date/Time Pickers
Asked by
Anshita
Top achievements
Rank 1
Answers by
Anshita
Top achievements
Rank 1
Share this question
or