Javascript “我的确认”对话框上显示许多按钮

Javascript “我的确认”对话框上显示许多按钮,javascript,jquery,jquery-ui,web,Javascript,Jquery,Jquery Ui,Web,我想在删除一些数据之前进行确认对话框。但有这么多按钮是这样显示的: 这是我的代码: <t:pagelink page="SUM01005e" context="[clientProduct.client.clientId, clientProduct.aggregator.aggregatorId, clientProduct.postpaidProduct.billerCode]" onclick="return deleteConfirmation(this, '${clientPr

我想在删除一些数据之前进行确认对话框。但有这么多按钮是这样显示的:

这是我的代码:

<t:pagelink page="SUM01005e" context="[clientProduct.client.clientId, clientProduct.aggregator.aggregatorId, clientProduct.postpaidProduct.billerCode]" onclick="return deleteConfirmation(this, '${clientProduct.aggregator.name}','${clientProduct.postpaidProduct.billerCode}','${clientProduct.productName}');"><img src="/sbgss/images/delete.png"/></t:pagelink>
为此:

<div id="deleteConfirmation" title="Delete Ag Mapping - Confirmation" style="display:none">
        <table>
            <tr><td colspan="3">${message:areyousuretoremovethisdata}</td></tr>
            <tr>
                <td>Aggregator</td>
                <td style="width:10px">:</td>
                <td><span id="agName"></span></td>
            </tr>
            <tr>
                <td>Product Code</td>
                <td>:</td>
                <td><span id="productCode"></span></td>
            </tr>
            <tr>
                <td>Product Name</td>
                <td>:</td>
                <td><span id="productNameBox"></span></td>
            </tr>
        </table>
    </div>

${消息:您确定要删除此数据吗}
聚合器
:
产品代码
:
品名
:

如何解决这个问题?

我无法复制您描述的问题。我使用了以下测试代码片段

$(函数($j){
函数deleteConfirmation(ele、agName、productCode、productNameBox){
$j(“#agName”).html(agName);
$j(“#productCode”).html(productCode);
$j(“#productNameBox”).html(productNameBox);
$j(“#删除确认”)。对话框({
按钮:[{
文字:“OK”,
“类”:“按钮-按钮-药丸-按钮-扁平主按钮-微小ui状态焦点”,
单击:函数(){
window.location=$j(ele.attr(“href”);
}
},
{
文本:“取消”,
样式:“左边距:10px”,
“类”:“按钮-按钮-药丸-按钮-扁平主按钮-微小ui状态焦点”,
单击:函数(){
$j(此).dialog(“关闭”);
}
}
]
});
返回false;
}
$j(“.delete”)。单击(函数(){
删除确认(this,$(this).data(“ag名称”),$(this).data(“产品代码”),$(this).data(“产品名称框”);
});
});

您确定要删除此数据吗?
聚合器
:
产品代码
:
品名
:

对于不针对原因的脏解决方案,您可以传递open函数,该函数是一个用于隐藏按钮的回调函数。看看这个:您应该了解为什么javascript函数会执行这么多次。使用这些给定的代码行是不可能的。我怀疑其他代码正在操纵您的对话框。没有任何东西会在您提供的代码中生成额外的按钮。请提供一个最小的、可重复的示例:是否可能与其他js冲突?@Lius是的,这是可能的。由于您没有在您的帖子中包含有关moch性质的详细信息,我不能自信地说,这正在发生在您身上。我无法在测试中复制该问题。
<div id="deleteConfirmation" title="Delete Ag Mapping - Confirmation" style="display:none">
        <table>
            <tr><td colspan="3">${message:areyousuretoremovethisdata}</td></tr>
            <tr>
                <td>Aggregator</td>
                <td style="width:10px">:</td>
                <td><span id="agName"></span></td>
            </tr>
            <tr>
                <td>Product Code</td>
                <td>:</td>
                <td><span id="productCode"></span></td>
            </tr>
            <tr>
                <td>Product Name</td>
                <td>:</td>
                <td><span id="productNameBox"></span></td>
            </tr>
        </table>
    </div>