weixin_33717117 2015-02-13 04:13 采纳率: 0%
浏览 2

href和bootstrap模态

I am trying to implement a modal functionality with an application and I am bit stuck.

use case: On an user's dashboard they are bunch of links for the various applications. When user tries to access those link, a modal with terms and condition should pops and when the user accepts the condition then a new windows should open depending on the application link user selected. These links are dynamic and generated on UI based on database.

Non modal implementation:

<div class="col-xs-12" nopadding>
    <ul class="nopadding padded-side-20">
        <c:forEach var="app" items="${appAndLink}">
            <li><a href="#" onClick="openJSWindow('${app.value}', '${app.key}', true)">${app.key}</a></li>
        </c:forEach>                                                                
    </ul>
</div>

Modal Implementation:

<c:forEach var="app" items="${appAndLink}">
    <li><a href="#" id="modalbutton" data-toggle="modal" data-height=320 data-width=450 data-target="#myModalAccessApp">${app.key}</a></li>
</c:forEach>
<div class="modal fade" id="myModalAccessApp" tabindex="-1" role="dialog" aria-labelledby="myModalAccessAppLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header nopadding padded-side-20 padded-tb-10">
                <button type="button" class="close" 
                data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalAccessAppLabel">
                    Systems Use Notification
                </h4>
            </div>
            <div class="row">
                <div class="col-lg-12 gray-divider"></div>
            </div>
            <div class="modal-body" id ="modalID">
                <p> Terms and condition </p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-success" onclick="openJSWindow('${app.value}', '${app.key}', true)" data-dismiss="modal">
                    I Accept
                </button>
                <button type="button" class="btn btn-success" 
                data-dismiss="modal">Cancel
                </button>
            </div><!-- /.modal-footer -->
        </div>
    </div>
</div> <!-- /.modal-Ends --> 

</ul>
</div>  

I am not able to pass the ${app.value}, ${app.key} value to the modal which I have created. Kindly let me know if this can be done with jQuery or AJAX. I have very limited knowledge on these.

Thank you for the help.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 对于squad数据集的基于bert模型的微调
    • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
    • ¥20 steam下载游戏占用内存
    • ¥15 CST保存项目时失败
    • ¥15 树莓派5怎么用camera module 3啊
    • ¥20 java在应用程序里获取不到扬声器设备
    • ¥15 echarts动画效果的问题,请帮我添加一个动画。不要机器人回答。
    • ¥15 Attention is all you need 的代码运行
    • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
    • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事: