模式弹出窗口没有显示在另一个模式弹出窗口的顶部

modal popup not showing on top of another modal popup

本文关键字:模式 窗口 顶部 另一个 显示      更新时间:2023-09-26

已更新

我试图在另一个模态上使用模态作为确认提示,但在onclick上看不到确认模态。这是我设置的模态属性。

父模式

我在我的asmx文件中调用我的父模态,然后在asmx中也调用我的子模态函数。

<div id="ShowDetails" class="popup" tabindex="-1" style="position:absolute;" role="dialog">
    <div class="panel panel-green">
        <div class="panel-heading">Parchase Request Details</div>
        <div class="panel-body">
            <div class=" col-md-12">
                <div class="form-inline">
                    <input id="pdid" style="display: none; width: 90PX; margin: 2px;" type="hidden" />
                    <%--<asp:HiddenField ID="PDId" runat="server" />--%>
                    <table class="table table-condensed">
                        <tr>
                            <td>
                                <input id="item" style="display: none; width: 90PX; margin: 2px;" /></td>
                            <td>
                                <input id="quantity" style="display: none; width: 90PX; margin: 2px;" />
                            </td>
                            <td>
                                <input id="eprice" style="display: none; width: 90PX; margin: 2px;" />
                            </td>
                            <td>
                                <input id="make" style="display: none; width: 90PX; margin: 2px;" />
                            </td>
                            <td>
                                <input id="discription" style="display: none; width: 90PX; margin: 2px;" />
                            </td>
                            <td>
                                <a id="DoneEditingbtn" role="button" onclick="DoneEditing()" style="color: #72c02c; display: none; width: 100PX; margin: 2px;">Update</a>
                            </td>
                            <td><a id="cancleediting" role="button" onclick="cancleeditingdetail()" style="color: #72c02c; display: none; width: 100PX; margin: 2px;">cancel</a>
                            </td>
                        </tr>
                    </table>
                    <table class="table table-condensed">
                        <thead>
                            <tr style="background-color: #01cc66;">
                                <th>Item Name</th>
                                <th>Quantity</th>
                                <th>Estimated Price</th>
                                <th>Make</th>
                                <th>Discription</th>
                                <th>Options</th>
                            </tr>
                        </thead>
                        <tbody id="tblgetdetails">
                        </tbody>
                    </table>
                    <div id="Alert"></div>
                </div>
            </div>
        </div>
        <span class="popup-btn-close" data-dismiss="modal">close</span>
    </div>
</div>

确认模式

    <div id="ApproveMod" class="popup" style=" z-index:2; position:absolute; left: 50%; width: 40%; border: 10px solid #666;">
    <div class="col-lg-6">
        <i>Are you sure to Approve this data?</i>
    </div>
    <i id="pheadIdApp"></i>
    <i id="pbdIdApp"></i>
    <div class="col-lg-6">
        <a class="btn-u btn-u-red" href="#" role='button' style="text-align: center; width: 45%;" onclick="Approve()">Yes </a>
        <button class="btn-u btn-u-green-custom " style="text-align: center; width: 45%;" data-dismiss="modal">NO</button>
    </div>
</div>

Parent模态显示正常,但当我点击应该切换子模态的Parent模态按钮时,它不起作用。在ASMX中,我在onclick上定义了我的子模态函数,如下所示。

<a role='button' class='form-control' onclick='AppModal(PHId+","+PBDId)'>Approve</a>

这是我在脚本中使用的儿童调用方法。

function AppModal(phid,pbdid) {
        $("#pheadIdApp").val(phid);
        $("#pbdIdApp").val(pbdid);
        $("#ApproveMod").modal("show");
    }

它应该能正常工作——我已经用过很多次了,但现在我被卡住了,不知道我可能在哪里错过了这个技巧——任何形式的帮助都是事先准备好的。

真的很有趣昨天我得到了你对我的问题的回答,那是关于同一个问题的,现在我发现你被困在这里了。将您的子模态位置更改为相对位置,并为默认层指定大于1040的z索引值。