@
bdbai 下面是打开往来单位列表选择:
<form name="form1" id="form1" method="post" action="./exe_current_account.php">
<input name="id" class="mini-hidden" />
<div style="padding-left:11px;padding-bottom:5px;">
<table style="table-layout:fixed;">
<tr>
<td style="width:70px;">往来单位:</td>
<td style="width:150px;">
<input name="current_unit" id="btnEdit1" class="mini-buttonedit" onbuttonclick="onButtonEdit"/>
将选取的 current_unit 提交给 php 接收
<script type="text/javascript">
mini.parse();
function onButtonEdit(e) {
var btnEdit = this;
mini.open({
url: "./current_unit.html",
title: "选择往来单位",
width: 650,
height: 380,
ondestroy: function (action) {
if (action == "ok") {
var iframe = this.getIFrameEl();
var data = iframe.contentWindow.GetData();
data = mini.clone(data);
//btnEdit.setValue(
data.id);
btnEdit.setText(data.text);
//alert(data.text);
}
}
});
}
</script>
下面是 current_unit.html 显示往来单位列表
<script type="text/javascript">
mini.parse();
var grid = mini.get("grid1");
//动态设置 URL
grid.setUrl("./data/AjaxService.php?method=SearchEmployeesUnit");
//也可以动态设置列 grid.setColumns([]);
grid.load();
function GetSelecteds() {
var rows = grid.getSelecteds();
return rows;
}
function GetData() {
var rows = grid.getSelecteds();
var ids = [], texts = [];
for (var i = 0, l = rows.length; i < l; i++) {
var row = rows[i];
ids.push(
row.id);
texts.push(row.current_unit);//将选中的行(列名)放进表单
}
var data = {};
data.id = ids.join(",");
data.text = texts.join(",");
return data;
}