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

Kendo Mobile - Binding not working for input="time"

6 Answers 74 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Gonzalo
Top achievements
Rank 1
Gonzalo asked on 13 Feb 2015, 06:19 PM
Hi, I'm developing a mobile app with Kendo.

When I try to use an input with type="time", the bindings do not appear to work with it.
Specifically, I'm only trying to use the "value" binding.

<input type="time" data-bind="value: timeSpent" />

Does someone know if this type of input is not supported? If that's the case, any time picker control that you can recommend?

Thanks.
Gonzalo

6 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 17 Feb 2015, 09:12 AM
Hello Gonzalo,

I assume the issue occurs because by default the value binding will not parse JavaScript objects into the required format. For more information please check this forum thread:

In the thread you will find example for date and dateTime inputs. You may follow the same approach to build time custom binding.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Gonzalo
Top achievements
Rank 1
answered on 27 Feb 2015, 02:43 PM
Thanks for the reply Alexander.

I tried the approach suggested on the link you provided but the problem is that the "change" callback is never invoked, so my view model is never updated with the user-entered data.

Do you know why that callback is not being invoked?
0
Petyo
Telerik team
answered on 02 Mar 2015, 04:27 PM
Hello Gonzalo,

can you please post your current implementation in a Dojo? We will review it and help you further. Thank you in advance.

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Gonzalo
Top achievements
Rank 1
answered on 03 Mar 2015, 06:05 PM
This is what I have: http://dojo.telerik.com/omACI

FYI, I'm working on a mobile application.
0
Accepted
Alexander Valchev
Telerik team
answered on 05 Mar 2015, 09:22 AM
Hi Gonzalo,

The init method of the binder is missing. In the init method you should bind to the change event of the input and call the change method of the binder.
Please see the updated example:

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Gonzalo
Top achievements
Rank 1
answered on 05 Mar 2015, 02:44 PM
That was it. It's working now.

Thanks a lot for your help Alex.

-
Gonzalo
Tags
MVVM
Asked by
Gonzalo
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Gonzalo
Top achievements
Rank 1
Petyo
Telerik team
Share this question
or