Closed kirtapatrik closed 11 years ago
It's not possible currently. What's your use-case?
I generate n <td>
depends on a variable count.
Actually i create them with a dummy array with length n and a virtual foreach.
But this is not really fast.
So why can't you use an element for the repeat
?
Because the repetition is in the middle of the table.
<tr><td>fix</td><td>fix</td> repetition--> <td>n</td> <td>fix</td></tr>
You should be able to do this:
<tr><td>fix</td><td>fix</td><td data-bind="repeat: n">n</td><td>fix</td></tr>
Yes of course, great, my fault. thx, for your support
You're welcome.
I ran into this same issue but I also need to set the id of the td. I tried:
<td data-bind="repeat:{foreach:$root.titlePlant.displayDefinition().sourcesToProcess[$data.SearchableIndexDisplayFieldID],item: '$field'},attr:{'class':'MemberField Field' + $field().SearchableIndexFieldID + ' FieldSource' + $field().SearchableIndexDisplayFieldSourceID}">
I got $field doesn't exist. With a virtual binding I could get a ref to each item and set the id.
repeat
should generally be the only binding in data-bind
. The bindings for each repeated item should be in data-repeat-bind
.
<td
data-bind="repeat:{foreach:$root.titlePlant.displayDefinition().sourcesToProcess[$data.SearchableIndexDisplayFieldID], item:'$field'}"
data-repeat-bind="attr:{'class':'MemberField Field' + $field().SearchableIndexFieldID + ' FieldSource' + $field().SearchableIndexDisplayFieldSourceID}">
Ahh...ok....makes sense
How is it possible, to use the binding as a virtual element?