Closed zpisgod closed 10 years ago
There's a model like that
... { List<int> Items... }
Then when you rendering checkboxes like that
@using(var items = ko.Foreach(m = m.Items) { @items.Html.Checkbox(m => m % 2 == 0); }
you'll get output like that
<input type="checkbox" data-bind="checked : ((parseInt() % parseInt(2)) == 0)"/>
it should be
<input type="checkbox" data-bind="checked : ((parseInt($data) % parseInt(2)) == 0)"/>
So, I have to use it like that:
@using(var items = ko.Foreach(m = m.Items) { @items.Html.Checkbox(m => "$data % 2 == 0"); }
It works as expect but it's not grace...
There's a model like that
Then when you rendering checkboxes like that
you'll get output like that
it should be
So, I have to use it like that:
It works as expect but it's not grace...