我已經在asp.net下表:添加行<table>動態
<table style="width: 98%" id="tblOtherDoc">
<tr>
<td style="width: 10; text-align: left;">
<span">Documents:</span>
</td>
</tr>
<tr>
<td>
<asp:HiddenField ID="hidOtherPath" runat="server" Value='<%# Bind("UploadLocationOther") %>' />
<a href="#" style="font-size: 12px; color: #2014FF; float: left; vertical-align: middle" onclick="uploadNew(this)">Add Other</a> <span style="float: left;">
<asp:CheckBox ID="cbOther" runat="server" onclick="otherDocsClicked(this)" Checked='<%# Bind("OtherAttached") %>' /></span>
<a href="#" style="font-size: 12px; color: #2014FF; float: left; vertical-align: middle" onclick="downloadFile(this)" title="docOther">View</a>
</td>
</tr>
</table>
每次點擊複選框,我使用jQuery添加一個新的精確行表(這樣,多文檔可以是添加)。
// Add new area for Other Document attachements
function otherDocsClicked(row) {
var isChecked = $(row).closest("tr").find("input[type=checkbox][id*=cbOther]").is(':checked');
if (isChecked == true) {
var clone = $('#tblOtherDoc tbody>tr:last').clone(true);
clone.find("input[type='hidden'], select").val("");
clone.find("input[type='checkbox'], checked").removeAttr('checked');
clone.insertAfter('#tblOtherDoc tbody>tr:last');
}
}
我想知道如何當我做一個get返回的是已經添加的文檔列表中添加這些行動態使用C#。
或者,如果有人認爲有更好的方法來做到這一點,我會非常感謝任何輸入,因爲這是我能想出的唯一解決方案,它似乎給我比別的更麻煩。
我已經使用這個嘗試,但我使用時有問題是,我上的onclick CheckBox(我稱之爲添加另一個重複行jquery)不再觸發。 –
Melanie
發佈您的jQuery代碼。 –
jQuery已發佈 – Melanie