我正在使用包含多個ID的AjaxSelect。通過選擇一個id,這個id的附加信息應該顯示在一個給定的表格中,該表格將由一個片段生成。現在我想知道哪個是最好的解決方案來刷新我的列表?電梯:刷新/重新加載代碼段
HTML:
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr class="lift:MainScreen.cars">
<td><car:name /></td>
<td><car:type /></td>
</tr>
</tbody>
</table>
SCALA:
def doSelect(msg: NodeSeq) = {
SHtml.ajaxSelect(cars.map(i => (i.no.toString, i.no.toString + ". Car")),
Empty, {
selectedCar =>
controller.chooseCar(selectedCar.toInt)
// RELOAD TABLE
})
}
def cars(node: NodeSeq): NodeSeq = {
val cars = controller.chosenCarFamily.cars
cars match {
case null => Text("There is no items in db")
case game => game.flatMap(i =>
bind("car", node,
"name" -> car.name,
"type" -> car.type))
}
}
在功能的汽車,是不是我' .name'而不是'car.name'? – 2012-01-30 23:17:00