【发布时间】:2011-12-15 08:32:03
【问题描述】:
我是 grails 的新手,我想将 html 表 'cart_table' 的内容(当前位于 shoppingcart.gsp 中)写入 _carttemplate.gsp 并通过包含此表在另一个 gsp(如 summary.gsp)中显示此表新模板。
目前我在 shoppingcart.gsp 中定义的表如下:
<table id="newTable" style="display:none">
<thead><th>item name</th><th>desc</th><th>business justification</th><th>start date</th><th>end date</th></thead>
<tbody></tbody>
</table>
我按如下方式填充正文
$("#confirmbutton").click(function(){
var ntr='',//to store html for new table row
rows=[],//to collect new rows
$tbl=$("#table_rolecart tbody"),//original table
l=$("tr", $tbl).length;//length of rows in original table's tbody section
var row, brow, drow;
:
: /* getting rows from other tables */
}
$("#newTable tbody").append(rows.join(''));
如何将表格放入template.gsp?在确认页面中如何显示表格?
【问题讨论】: