Here is the code: http://jsfiddle.net/Gr3fT/1/
How to filter personRoles
by role
property?
Each list must have only own role
items.
Thanks.
This function works (based on http://knockoutjs.com/examples/animatedTransitions.html :)
get: function(role)
{
return ko.dependentObservable(function ()
{
return ko.utils.arrayFilter(this.personRoles(), function(item)
{
return item.id == role;
});
}, viewModel);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With