写一个父页面方法,将name和id赋值

function show(name,id) {
$("#deptnoID").val(name);
$("#deptnoId").val(id);
}
$(function() {

 

回调函数,对应easyDialog.open方法中的yesFn : btnFn,先用.contentWindow获取iframe的window对象,取出id和name。返回值true表示不关闭弹窗

var btnFn = function(){
var iframe=document.getElementById("iframe").contentWindow;
var id=iframe.id; 
var name = iframe.name;
return true;
};

 


获取文本框,触发单击事件,在content用iframe标签嵌入zTree树杈菜单,并加入样式frameborder="0":无边框, height="380":高度, scrolling="no":无滚动条

$("#deptnoID").click(function() {
easyDialog.open({
container : {
header : "选择部门",
content : '<iframe >,
yesFn : btnFn,
noFn : true
}
});
});
});

 

zTree中子页面的回调函数,将父页面show方法赋值的name和id传进来

callback: {
onClick: function(event, treeId, treeNode){
parent.show(treeNode.name,treeNode.id);
}
}

 

相关文章:

  • 2021-09-17
  • 2021-11-13
  • 2018-05-05
  • 2021-10-12
  • 2021-12-27
  • 2021-10-14
  • 2021-12-09
猜你喜欢
  • 2021-12-21
  • 2022-02-01
  • 2021-06-15
  • 2021-08-25
  • 2021-08-26
  • 2022-12-23
相关资源
相似解决方案