Create new row every 2 records using knockout foreach

后端 未结 2 986
旧巷少年郎
旧巷少年郎 2021-01-06 03:53

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.

2条回答
  •  长发绾君心
    2021-01-06 04:11

    You're better off supplying knockout with a multi-dimensional array. This is a much cleaner solution and has less potential for quirky results.

    Look at Example 2: Note 3: in the documentation: http://knockoutjs.com/documentation/foreach-binding.html

      • :

提交回复
热议问题