我正在使用包含多个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