easyui dialog iframe模式,dialog 父級頁面調用子頁面(iframe)的方法


var content = '<iframe id="iframe1" name="iframeuuid" src="' + url + '" width="100%" height="98%" frameborder="0" scrolling="no"></iframe>';
var div = document.createElement('div');
div.id = "sbkSelectDialog";
document.body.appendChild(div);
$('#selectDialog').dialog({
title: '選擇',
width: 1000,
height: 600,
closed: false,
cache: false,
//href: url,
content:content,
modal: true,
buttons:[{
text:'保存',
iconCls:'icon-save',
handler:function(){
//獲取iframe里面的內容
var childWin = document.getElementById('iframe1').contentWindow;
//調用子頁面對象,子頁面的方法
var rows = childWin.selectedDevListGrid.getSelectDevList();
if(rows){
if(rows.length==0){
$.messager.alert('提示','請選擇需要選擇的設備!');
}else{
console.log(rows);
}
}

}
},{
text:'關閉',
iconCls:'icon-close',
handler:function(){
$("#selectDialog").dialog('destroy');
}
}],
onClose : function() {
$(this).dialog('destroy');
},
onLoad:function(){

}
});


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM