• <i id='ZrWN5'><tr id='ZrWN5'><dt id='ZrWN5'><q id='ZrWN5'><span id='ZrWN5'><b id='ZrWN5'><form id='ZrWN5'><ins id='ZrWN5'></ins><ul id='ZrWN5'></ul><sub id='ZrWN5'></sub></form><legend id='ZrWN5'></legend><bdo id='ZrWN5'><pre id='ZrWN5'><center id='ZrWN5'></center></pre></bdo></b><th id='ZrWN5'></th></span></q></dt></tr></i><div id='ZrWN5'><tfoot id='ZrWN5'></tfoot><dl id='ZrWN5'><fieldset id='ZrWN5'></fieldset></dl></div>
      <tfoot id='ZrWN5'></tfoot>

        <bdo id='ZrWN5'></bdo><ul id='ZrWN5'></ul>

      1. <legend id='ZrWN5'><style id='ZrWN5'><dir id='ZrWN5'><q id='ZrWN5'></q></dir></style></legend>

        <small id='ZrWN5'></small><noframes id='ZrWN5'>

        父窗口获取layer.open()打开的子窗口的数据

        时间:2023-11-08

        <i id='oYCfG'><tr id='oYCfG'><dt id='oYCfG'><q id='oYCfG'><span id='oYCfG'><b id='oYCfG'><form id='oYCfG'><ins id='oYCfG'></ins><ul id='oYCfG'></ul><sub id='oYCfG'></sub></form><legend id='oYCfG'></legend><bdo id='oYCfG'><pre id='oYCfG'><center id='oYCfG'></center></pre></bdo></b><th id='oYCfG'></th></span></q></dt></tr></i><div id='oYCfG'><tfoot id='oYCfG'></tfoot><dl id='oYCfG'><fieldset id='oYCfG'></fieldset></dl></div>
      2. <legend id='oYCfG'><style id='oYCfG'><dir id='oYCfG'><q id='oYCfG'></q></dir></style></legend>
        • <small id='oYCfG'></small><noframes id='oYCfG'>

            <tbody id='oYCfG'></tbody>

            <tfoot id='oYCfG'></tfoot>
                <bdo id='oYCfG'></bdo><ul id='oYCfG'></ul>
                  1.获取子页面的表格多选框选中的数据
                   var index = layer.open({
                          type: 2,
                          title: '标题',
                          maxmin: true,
                          shadeClose: false, // 点击遮罩关闭层
                          area: ['800px', '520px'], //子页面大小
                          btn: ['按钮名称'],
                          btnAlign: 'c',
                          content: '请求路径', // iframe的url
                          yes: function (index, layero) { //按钮【按钮一】的回调
                              //获取弹出层容器
                              var iframeWin = window[layero.find('iframe')[0]['name']];  
                              //获取弹出层$('#exampleTable').bootstrapTable选中行数据            
                              var rows = iframeWin.$('#exampleTable').bootstrapTable('getSelections');
                              
                              //获取到表格的选中行数据,进行后续操作
                              for(let i; i < rows.length; i++){
                                  console.log(rows[i].id) //id是该行内的属性
                              }             
                   
                              layer.close(index);
                          }
                      });
                      layer.full(index); //弹出层全屏显示
                  2.获取子页面的表格单选框选中的数据
                      var index = layer.open({
                          type: 2,
                          title: '标题',
                          maxmin: true,
                          shadeClose: false, // 点击遮罩关闭层
                          area: ['800px', '520px'],
                          btn: ['按钮名称'],
                          btnAlign: 'c',
                          content: '请求路径', // iframe的url
                          yes: function (index, layero) {
                              //按钮【按钮一】的回调
                              let obj = layero.find('iframe')[0].contentWindow;
                              let list = obj.getSelection();
                   
                              console.log(list[0].id);
                   
                              layer.close(index);
                          }
                      });
                      layer.full(index);
                  3.获取子页面的input值,及给子页面的input赋值
                   var index = layer.open({
                          type: 2,
                          title: '标题',
                          maxmin: true,
                          shadeClose: false, // 点击遮罩关闭层
                          area: ['800px', '520px'],
                          btn: ['按钮名称'],
                          btnAlign: 'c',
                          content: '请求路径', // iframe的url
                          success: function (layero, index) {
                              //成功回调,给子页面赋值
                              var body = layer.getChildFrame('body', index); //得到iframe页的body内容
                              body.find("#子页面id").val('赋值');
                          },
                          yes: function (index, layero) {
                              //按钮【按钮一】的回调,获取子页面的值
                              var body = layer.getChildFrame('body', index); //得到iframe页的body内容
                              console.log(body.find("#子页面id").val());
                              
                              layer.close(index);  //关闭子页面
                          }
                      });
                      layer.full(index);
                   
                  上一篇:Layui内置方法layer.getChildFrame(获取iframe页的DOM) 下一篇:没有了

                  相关文章

                  <small id='Msw0V'></small><noframes id='Msw0V'>

                  <legend id='Msw0V'><style id='Msw0V'><dir id='Msw0V'><q id='Msw0V'></q></dir></style></legend>
                  <i id='Msw0V'><tr id='Msw0V'><dt id='Msw0V'><q id='Msw0V'><span id='Msw0V'><b id='Msw0V'><form id='Msw0V'><ins id='Msw0V'></ins><ul id='Msw0V'></ul><sub id='Msw0V'></sub></form><legend id='Msw0V'></legend><bdo id='Msw0V'><pre id='Msw0V'><center id='Msw0V'></center></pre></bdo></b><th id='Msw0V'></th></span></q></dt></tr></i><div id='Msw0V'><tfoot id='Msw0V'></tfoot><dl id='Msw0V'><fieldset id='Msw0V'></fieldset></dl></div>

                    <tfoot id='Msw0V'></tfoot>

                      <bdo id='Msw0V'></bdo><ul id='Msw0V'></ul>