Bind checkboxes to a list of numbers

2 posts, 0 answers
  1. Pavel
    Pavel avatar
    15 posts
    Member since:
    May 2012

    Posted 04 Feb 2015 Link to this post

    When binding a checkbox to an array property, it works only if array contains strings, but does not work with numbers:

    <label><input type="checkbox" value="1"   data-bind="checked: colors" />Red</label>

    var viewModel = kendo.observable({
    //colors: ["1", "2", "3"] //works
        colors: [ 1, 2, 3 ] //does not work

    Would be nice to remove this limitation to have a cleaner view model.
    Here's a dojo representing it:

  2. Alexander Popov
    Alexander Popov avatar
    1411 posts

    Posted 06 Feb 2015 Link to this post

    Thanks for the feedback Pavel!

    I am glad to say that we are already working on strongly typed value and checked binding implementation, that would handle such scenarios. Keep an eye on the our Roadmap for additional details.

    Alexander Popov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top