我正在动态地将行添加到 Jquery 对话框中存在的表中。每当关闭对话框时,我想清除该表的除第一行之外的所有行,这样如果再次打开对话框,则只能看到新的行集。
我的目标是在打开此对话框时带一个空表。
这是我的对话框代码
$( "#personPmt" ).dialog({
autoOpen: false,
width: 675,
modal: true,
position: { my: "left top", at: "left bottom", of: $("#pmtDetails") },
close: function() {
$('#personPmtTable').remove("tr:gt(0)");
}
});
这是我的对话
<div id="personPmt" title="Personal Payment">
<table border="0" cellpadding="0" cellspacing="0" class="pmtEntry" id="personPmtTable">
<tr>
<th style="display:none">ID</th>
<th class="cell_date">DOS</th>
<th class="cell_code">CPT</th>
<th class="cell_name">Description</th>
<th class="cell_amt">Billed</th>
<th class="cell_amt">Payment</th>
<th class="cell_amt">Balance</th>
<th class="cell_amt">New Balance</th>
</tr>
</table>
</div>