Ryan,
Thanks for the feedback. I'm very new to Knockout, so I'm still trying to figure my way around. Some thoughts and comments:
1. In a sense, doing UI virtualization for lists only makes sense to me when you have something like a template binding. So you might have something like:
data-bind="template { data: someList, virtualize: true, virtualizeCount:60, name: someTemplate, itemTemplate: someItemTemplate }"
This is because Knockout needs to know how to "re-use" a template in order to change up which specific items are bound to it.
2. Another thing to note is that while virtualization is similar to paging, it is continuous rather than discrete. So if you have 100 items and are currently only displaying items 10-20, then if you scroll one down, you should be displaying items 11-21, etc. Given that I wonder if continuously copying a slice of the observable array is not too expensive.
3. In an ideal world, Knockout would automatically figure out how many items can fit on the screen at once for that list, and multiply it by 3 (one for the visible part, and one each for above and below so you have smooth scrolling). That way, it would always render only what's necessary, rather than you having to figure this out for yourself.
4. You're absolutely right that you need to hook into scroll events to figure out when a certain items goes out of view, so that you can adjust your item offset by 1. At that point, you'd also need to do some interesting things if you wanted to reuse DOM elements rather than keep creating and destroying them.
5. The notion of using AJAX is a great idea - that would actually fall under data virtualization, since you're allowing less than the complete set of data to be present. I'd love to see this too, but first let's start with just UI virtualization.
If you combine data and UI virtualization you can get very performant apps that work great on both mobile and desktop browsers, since you're significantly reducing the amount of memory that's required.
Anyway, I'd love to hear if anyone else has more thoughts. I'll try and see if I can figure out enough of Knockout to know what to do (and I'm certainly a newb when it comes to the DOM), but if anyone else wants to take a crack, feel free.
Itay