I have a grid that is using a popup editor and in the editor is a listview that I'm binding to a collection on the viewmodel. After the listview is bound I'd like to initialize the inputs as timepickers.
However, the time picker inputs don't seem to get initialized. Everything works as expect except the timepicker isn't getting initialized.
One thing I noticed is that if use kendo.render and use the template I can get the inputs to initialize as timepickers.
here's the listview:
here's the template:
here's the jQuery I'm running in the edit event of the grid:
this is the method that works:
However, the time picker inputs don't seem to get initialized. Everything works as expect except the timepicker isn't getting initialized.
One thing I noticed is that if use kendo.render and use the template I can get the inputs to initialize as timepickers.
here's the listview:
<
div
class
=
"container"
id
=
"list"
data-role
=
"listview"
data-bind
=
"source: data"
data-template
=
"list-tmpl"
/>
<
script
id
=
"list-tmpl"
type
=
"text/x-kendo-template"
>
<
div
class
=
'row'
>
<
div
class
=
"input-append bootstrap-timepicker"
>
<
input
type
=
"text"
class
=
"input-small timepicker"
data-bind
=
"value:StartTime"
required />
<
span
class
=
"add-on"
><
i
class
=
"icon-time"
></
i
></
span
>
</
div
>
</
div
>
</
script
>
var items = $(".timepicker");
$.each(items, function () {
var el = $(this);
el.timepicker({
minuteStep: 1
});
});
var tmpl = kendo.template($('#list-tmpl').html());
var results = kendo.render(tmpl, e.model.data);
this.editable.element.data("kendoWindow").element.find("#list").html(results); // populate the listview
var items = $(e.container).find(".timepicker");
$.each(items, function () {
var el = $(this);
console.log(el);
//el.kendoTimePicker();
el.timepicker({
minuteStep: 1
}).on('show.timepicker', function (e) {
console.log(e);
});
});