We iterate through an array of items that are filtered and deleted from the observable array. If the deletion is large, 1000+, the page is unresponsive for maybe 4 seconds. Is there a way to get around this?
Script
for (m = 0, gamesLength = unscheduledGames.length; m < gamesLength; m++) {
viewModel.unscheduled.games.remove(unscheduledGames[m]);
}
DOM
<!-- ko foreach: games -->
<!-- ko if: $data.Matchup() && $data.Matchup().Selected() -->
<div class="item-container draggable-item-container clearfix">
...More Stuff
</div>
<!-- /ko -->
<!-- /ko -->
I think you want to use virtual scrolling for this. I don't really know knockout but I found this fiddle (jsfiddle.net/z4711/gk30zLs2/) with an example of implementation for virtual scroll in knockout (2 000 000 items displayed). Also this article might help you out.
Maybe it can give you some inspiration.