在弹出窗口中提交表单时隐藏数据表中的链接

时间:2014-03-21 11:45:44

标签: jquery struts2 datatable jquery-datatables

我需要在弹出窗口中提交表单时隐藏数据表中的链接。我在数据表中有Approve链接。它们仅针对特定行显示(对于batchInfo行)。当我点击链接弹出窗口打开时,当我完成弹出窗口中的表单提交时,我希望链接消失(隐藏它)。

数据表中的

脚本:

<s:if test="%{(batchInfo)}">
<td align="center" onclick="openapproverejectfile('<s:propertyvalue="#approvalURL"/>')">
<a id="ApproveRejectCPlink" href="#"><u>Approve</u></a>
</td>
</s:if>
<s:else>
<td></td>
</s:else>

我的数据表:

$(document).ready(function() {
searchresults = $("#searchclientfileresults").dataTable({
"sScrollX" : "100%",
"sScrollY":"220px",
"bSort":true,
"bAutoWidth" : false,
"bPaginate" : true,
"aLengthMenu": [[5, 10, 15, 20, -1], [5, 10, 15, 20, "All"]],
"sPaginationType" : "full_numbers",
"bLengthChange" : true,
"bFilter" : true,
"bInfo" : false,
"oLanguage": {
"sEmptyTable":   "No data available in table"
},
"aoColumns": [
null,
null,
null,
null,
null,
null,
null,
null
]
});
});

如何在数据表中的某些弹出窗口中隐藏表单提交链接?

1 个答案:

答案 0 :(得分:0)

$(document).ready(function () {
 $('#searchclientfileresults tr').click(function (event) { 
$('#searchclientfileresults tr').data('clicked', true); //select the row clicked in datatable 
}); });

有了这个,我们可以动态地选择链接的行。