I\'m attempting to create a new row every two records using knockout virtual elements. My problem is that the odd record does not generate in between the two even indexes.>
Knockout binding only happen on elements, and virtual elements must also adhere to the element hierarchy. If we take your example and use indentation to show the element relation, it looks like this:
The closing and opening virtual tags within the div
are ignored by Knockout. So the above just has the effect of outputting every other item.
Here is a good answer for doing grouping of array items in Knockout: https://stackoverflow.com/a/10577599/1287183