获取弹出窗口返回的值
需求:主界面的某项值需要从一个弹出的窗口中取值,如选择时间
实现:
(1) 主页面 js
< script type = "text/javascript" >
function fillIds(ids) {
alert( "aaaaaaa===" +ids);
}
</ script >
(2) 主页面调用
<input type="button" οnclick="window.open('/tree/product/html/treeOnly.html')" value=" 测试 " />
(3) 调用页面 js
< script type = "text/javascript" >
var url_tree = "/treeMaintain?_method=productTreeOnly" ;
Ext.onReady( function () {
var tree = new koolearn.base.select.Tree( {
width:230,
height:500,
buttons:[
{ text: " 确定 " ,handler: function () {
window.opener.fillIds(tree.getSelects());
window.close();
} ,scope: this }
]
} );
tree.render(document.body);
tree.loadData(url_tree);
} );
</ script >
以上。