I'm trying to show/hide items within a collection using a jQueryUI slider.
The slider returns values 1 to 10 and I want to show the item if the item's "win" property is higher than the slider's value and vice versa.
I've got so far:
http://jsfiddle.net/FloatLeft/uqv7D/
I was hoping that this code would set the item's visibility
ko.utils.arrayForEach(viewModel.euroTeams, function(team) {
team.win = ko.observable(team.win);
team.lose = ko.observable(team.lose);
team.showTeam = team.win() > viewModel.wins();
});
Template:
<div class="team" data-bind="visible: showTeam"></div>