zoukankan      html  css  js  c++  java
  • Layui父页面向子页面传参

    废话不多说!直接上代码!

    父窗体js

    $('.mytable').on('click', '.editRow', function () {
            var table = $('#table_id_example').DataTable();
            var rowData = table.rows({selected: true}).data()[0];
            if (rowData) {
                layer.open({
                    title: this.text,
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高
                    maxmin: true, //开启最大化最小化按钮
                    content: "taskDetail.html",
                    success: function (layero, index) {
                        // 获取子页面的iframe
                        var iframe = window['layui-layer-iframe' + index];
                        // 向子页面的全局函数child传参
                        iframe.child(rowData);
                    }
                })
            } else {
                alert("先选择行")
            }
        })
    
    

    子窗体

    
    <script>
        function child(d) {
          alert(d)
        //在这里你可以写你的jquery $(function(){ })   等等操作
    
    
        }
    </script>
    
    
  • 相关阅读:
    SpringBoot启动配置原理
    SpringBoot和web开发
    SpringBoot和日志
    SpringBoot入门
    Docker仓库
    Docker Swarm
    Docker相关概念
    Docker服务编排
    Dockerfile
    Docker应用部署
  • 原文地址:https://www.cnblogs.com/userzf/p/9448646.html
Copyright © 2011-2022 走看看