mirror of https://gitee.com/y_project/RuoYi.git
实例演示中弹出表格增加以回调形式回显到父窗体
parent
0e9d6794f3
commit
f0c32bc34b
|
@ -26,6 +26,7 @@
|
|||
<div class="ibox-content" id="test">
|
||||
<p>弹出复选框表格及单选框表格(点击提交后得到数据并回显到父窗体)。 </p>
|
||||
<button type="button" class="btn btn-info" onclick="selectUsersToParent()">弹出表格(复选框)</button>
|
||||
<button type="button" class="btn btn-warning" onclick="selectUsersToParentCallBack()">弹出表格(复选框)- 回调形式</button>
|
||||
<p id="userids"> </p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -48,6 +49,25 @@
|
|||
$.modal.open("选择用户", prefix + "/parent");
|
||||
}
|
||||
|
||||
function selectUsersToParentCallBack(){
|
||||
var options = {
|
||||
title: '选择用户',
|
||||
url: prefix + "/parent",
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var rows = layero.find("iframe")[0].contentWindow.getSelections();
|
||||
if (rows.length == 0) {
|
||||
$.modal.alertWarning("请至少选择一条记录");
|
||||
return;
|
||||
}
|
||||
$('#userids').html(rows.join())
|
||||
layer.close(index);
|
||||
}
|
||||
|
||||
function selectUsers(){
|
||||
alert(1);
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
$.table.init(options);
|
||||
});
|
||||
|
||||
/* 添加用户-选择用户-提交 */
|
||||
/* 添加用户-选择用户-提交(子页面调用父页面形式) */
|
||||
function submitHandler(index, layero) {
|
||||
var rows = $.table.selectFirstColumns();
|
||||
if (rows.length == 0) {
|
||||
|
@ -85,6 +85,11 @@
|
|||
// 父页面的变量
|
||||
parent.$('#userids').html(rows.join());
|
||||
}
|
||||
|
||||
/* 添加用户-选择用户-提交(回调形式-父页面调用子页面) */
|
||||
function getSelections() {
|
||||
return $.table.selectFirstColumns();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue