I have a Data binding like below using knockout and bootstrap css. i have this degreeCodes jSON that has let's say 40 items. but on UI side i only want 4 on each
<div class="row" >
the 5th one should create a new
<div class="row" >
and add the content there. so if it worked correctly it would have 10<div class="row" >
and each with 4 items of
<label class="text-muted" data-bind="text: DegreeName"></label>
how can i do a template like that? Where it adds a new div class row when it reaches n mod 4 =0 where n is the current item from jsonview being binded? i am ok with adding a parent div if that helps
<div class="row" data-bind="foreach: degreeCodes">
<label class="text-muted" data-bind="text: DegreeName">></label>
<div>
if it worked correctly it would be rendering something like...
<div class="row" data-bind="foreach: degreeCodes">
<label class="text-muted" data-bind="text: DegreeName"> Degree1</label>
<label class="text-muted" data-bind="text: DegreeName"> Degree2</label>
<label class="text-muted" data-bind="text: DegreeName"> Degree3</label>
<label class="text-muted" data-bind="text: DegreeName"> Degree4</label>
<div>
<div class="row" data-bind="foreach: degreeCodes">
<label class="text-muted" data-bind="text: DegreeName"> Degree5</label>
<label class="text-muted" data-bind="text: DegreeName"> Degree6</label>
<label class="text-muted" data-bind="text: DegreeName"> Degree7</label>
<label class="text-muted" data-bind="text: DegreeName"> Degree8</label>
<div>