我正在使用 struts2-jquery,我正在尝试创建一个模式对话框以确认删除某些内容。我不知道如何传递 id 或“确定”来完成操作。
下面是我基于 struts2-jquery 创建对话框的代码:
<sj:dialog
id="anchordialogconfirm"
buttons="{
'OK':function() {
//id of link is needed to c
$(this).dialog('close');
},
'Cancel':function() { $(this).dialog('close'); }
}"
resizable="false"
autoOpen="false"
modal="true"
title="Remove?"
>
Are you sure you want to remove it?
</sj:dialog>
<sj:a openDialog="anchordialogconfirm" id="71" cssClass="deleteemp">Delete</sj:a>
显然,如果我将 href='' 放入锚点,则对话框将打开到该链接,而不是获得模态确认对话框。
如何检索锚的 ID?我想要删除链接的 id 或至少禁止链接被使用,直到它“确定”这样做。