How Do I Set An HTML Attribute For a Scala List Item Using Lift CSS
Selectors?
I have some Lift code that creates table rows from a List:
".row *" #> myList.map(x => {
val rowId = x.id
".cell1" #> x.data &
".cell2" #> x.moreData
})
Based on a template like this:
<table>
<tr class="row">
<td class="cell1"></td>
<td class="cell2"></td>
<tr>
<table>
I want output like this:
<table>
<tr class="row" id="123">
<td class="cell1">stuff</td>
<td class="cell2">junk</td>
<tr>
<tr class="row" id="456">
<td class="cell1">more stuff</td>
<td class="cell2">more junk</td>
<tr>
<table>
How do I set that id attribute to be rowId for each tr based on my List
elements?
No comments:
Post a Comment