layer.open的yes函数中获取弹出层(子集iframe)中的元素或参数

 layer.open({
            type: 2,
            title: '弹出层',
            content: pageUrl,
            area: ['600px', '500px'],
            btn: ['确定', '取消'],
            shadeClose: true,
            btnAlign: 'r',
            yes: function (index, layero) {
                var iframeWin = window[layero.find('iframe')[0]['name']];
                var pageData = iframeWin.rightData, names = '', ids = '';
                for (var i = 0, n = deptsData.length; i < n; i++) {
                    ids += pageData[i].uuid + ',';
                    names += pageData[i].name + ',';
                }
                ids = ids.substr(0, ids.length - 1);
                names = names.substr(0, names.length - 1);
                $("#ids").val(ids);
                $("#names").val(names);
                $("#names").attr('title', names);

                layer.closeAll();
            },
            btn2: function () {
                layer.closeAll();
            }
        });

 

posted @ 2021-09-18 16:33  金刀3691  阅读(509)  评论(0编辑  收藏  举报