I have an existing knockout foreach like so:
<!-- ko foreach: reportFields -->
<tr>
<td><span class="hover" data-bind="text: FriendlyName, click:$parent.openField"></span></td>
<td><img src="img/cross.png" data-bind="click: $parent.removeField" class="delete" alt="Remove Field" title="Remove Field" /></td>
</tr>
<!-- /ko -->
What I need to do is filter the foreach further i.e. I want to check a field of each item to see if it equals 1, 2 or 3. I tried simply putting a knockout if statement directly after the ko foreach but it fails to work unless I put it after some html code which is a problem as I don't want to show anything unless it matches.
So my question is can I filter the ko foreach in some way with a where statement or something similar, or is there a way to get the if statement functioning without needing to have html before declaring it?