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

7 posts, 1 answers
  1. Gonzalo
    Gonzalo avatar
    17 posts
    Member since:
    Mar 2014

    Posted 13 Feb 2015 Link to this post

    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
  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 17 Feb 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Gonzalo
    Gonzalo avatar
    17 posts
    Member since:
    Mar 2014

    Posted 27 Feb 2015 in reply to Alexander Valchev Link to this post

    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?
  5. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 02 Mar 2015 Link to this post

    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!
     
  6. Gonzalo
    Gonzalo avatar
    17 posts
    Member since:
    Mar 2014

    Posted 03 Mar 2015 in reply to Petyo Link to this post

    This is what I have: http://dojo.telerik.com/omACI

    FYI, I'm working on a mobile application.
  7. Answer
    Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 05 Mar 2015 Link to this post

    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!
     
  8. Gonzalo
    Gonzalo avatar
    17 posts
    Member since:
    Mar 2014

    Posted 05 Mar 2015 in reply to Alexander Valchev Link to this post

    That was it. It's working now.

    Thanks a lot for your help Alex.

    -
    Gonzalo
Back to Top
Kendo UI is VS 2017 Ready