- 注册时间
- 2015-11-10
- 最后登录
- 1970-1-1
- 阅读权限
- 10
- 积分
- 59
- 精华
- 0
- 帖子
- 15
|
function LoadeGrid() {
var begindate = mini.get("BeginDate");
var enddate = mini.get("EndDate");
Grid.set({
url: Url,
style: "width:100%;height:" + ($(document).height() - 68) + "px",
allowAlternating: true,
allowUnselect: true,
multiSelect: true,
pageSize: 20,
onshowrowdetail: onShowRowDetail,
idField: "id",
columns: [
{ type: "expandcolumn", width: "30px" },
{ header: "月份", field: "ReportMonth", allowSort: "true", width: "20%", align: "center", headerAlign: "center", dateFormat: "yyyy-MM" },
{ header: "审核人", field: "AuditName", allowSort: "true", width: "65%", align: "center", headerAlign: "center" },
{ header: "状态", field: "State", allowSort: "true", renderer: "ShowState", width: "20%", align: "center", headerAlign: "center" }
]
});
Grid.render($("#div_datagrid")[0]);
Grid.load({ method: "GetReportMainList", BeginDate: begindate.getText(), EndDate: enddate.getText() });
}
生成主表格
//显示子表
function onShowRowDetail(e) {
var grid = e.sender;
var row = e.record;
var td = grid.getRowDetailCellEl(row);
$("#detailGrid_Form").css({ "display": "block" });
$("#detailGrid_Form").appendTo(td);
LoadeGrid2(row.RecordID);
}
在子表显示状态下,点击MINIUI自带的刷新(查询之类的方法也一样)后在发生onShowRowDetail事件会找不到detailGrid_Form?!
//按时间查找主表
function search() {
var begindate = mini.get("BeginDate");
var enddate = mini.get("EndDate");
$("#detailGrid_Form").appendTo($("#savediv"));
Grid.load({ method: "GetReportMainList", BeginDate: begindate.getText(), EndDate: enddate.getText() });
}
我在手动在查询的js文件中加入$("#detailGrid_Form").appendTo($("#savediv"));之后就能正常显示子表了
|
|