I am trying to create a new line every two records using virtual knockout elements. My problem is that the odd record is not generated between two even indices.
Here is my original HTML
<div class="row-fluid"> <div class="panel form-horizontal span6"> <div class="panel-heading"><span data-bind="text:$data.Caption"></span></div> </div> </div>
HTML output
<div data-bind="attr:{id:Name}" class="tab-pane active" id="Tabsheet1"> <div class="row-fluid"> <div class="panel form-horizontal span6"> <div class="panel-heading"><span data-bind="text:$data.Caption"></span></div> </div> </div> <div class="row-fluid"> <div class="panel form-horizontal span6"> <div class="panel-heading"><span data-bind="text:$data.Caption"></span></div> </div> </div> </div>
The panel should be created regardless of the condition. The condition determines only the opening of a new line on even numbers and the closing of the line by chances.
source share