modal

 通过这种方式绑定数据 $("#modalTarget").data("target", paras);

然后取出数据,   data: JSON.stringify($("#modalTarget").data("target")),

复制代码
<!-- Modal Update Failed-->
    <div class="modal fade" id="UpdateModalFailed">
        <div class="modal-dialog modal-sm">
            <div class="modal-content">
                <div class="modal-body">
                    <p id="modelFailedText" class="text-center" style="margin: 30px 0px;">&nbsp;</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><%= GetResourceValue("CP_PointAssignment_Cancel") %></button>
                </div>
            </div>
        </div>
    </div>
    <!-- Modal Confirm-->
    <div class="modal fade" id="modalConfirmAssignement">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span></button>
                    <h2><%= GetResourceValue("CP_PointAssignment_ConfirmAssignment") %></h2>
                </div>
                <div class="modal-body">
                    <table class="table text-center">
                        <thead>
                            <tr>
                                <th><%= GetResourceValue("CP_PointAssignment_TotalAssigned") %></th>
                                <th><%= GetResourceValue("CP_PointAssignment_RemainingPoints") %></th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>
                                    <em>
                                        <b class="green">0</b>
                                    </em>
                                </td>
                                <td>
                                    <b>0</b>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="modal-footer">
                    <div class="col-sm-6 text-center">
                        <button type="button" id="btnAssignmentAccept" data-loading-text="<%= GetResourceValue("CP_PointAssignment_Processing") %>" class="bt-rounded bt-green w-200"><%= GetResourceValue("CP_PointAssignment_Accept") %></button>
                    </div>
                    <div class="col-sm-6 text-center">
                        <button type="button" class="bt-rounded bt-gray w-200" data-dismiss="modal" aria-label="Close"><%= GetResourceValue("CP_PointAssignment_Cancel") %></button>
                    </div>
                    <input type="hidden" id="modalTarget" />
                </div>
            </div>
        </div>
    </div>
    <!-- Modal Assign Success-->
    <div class="modal fade " id="modalConfirmated">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content border-top-blue">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span></button>
                </div>
                <div class="modal-body">
                    <div class="w-100 margin-top-20  message">
                        <div class="inner-message ">
                            <i class="ico ico-mark-bold"></i>
                            <p>
                                <em id="emTitle"><%= GetResourceValue("CP_PointAssignment_AssignSucceed") %></em>
                            </p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
复制代码

 

data-dismiss

https://stackoverflow.com/questions/34627271/understanding-how-data-dismiss-attribute-works-in-bootstrap

The hiding functionality is implemented in the modal.js in this way.

this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))

Basically it's just finding the elements that have the attribute of data-dismiss and the value of modal. Upon click it will hide these elements.

 

作者:Chuck Lu    GitHub    
posted @   ChuckLu  阅读(507)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2017-05-31 在IIS中给某一个网站添加binding的坑
2017-05-31 Firefox中使用pac
2017-05-31 火狐浏览器设置bypass
2017-05-31 如何卸载visualsvn for visual studio
2016-05-31 perl的安装
点击右上角即可分享
微信分享提示