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

Bind checkboxes to a list of numbers

1 Answer 158 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Pavel
Top achievements
Rank 1
Pavel asked on 04 Feb 2015, 12:32 PM
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: http://dojo.telerik.com/uHaNO

Thanks.

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 06 Feb 2015, 09:35 AM
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.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
MVVM
Asked by
Pavel
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or