2015-10-28 22:49:59 +08:00
|
|
|
<div class="bjui-pageContent">
|
|
|
|
<div class="clearfix">
|
|
|
|
<div style="float: left; width: 220px; height: 240px; overflow: auto;" class="table table-bordered">
|
|
|
|
<ul id="orgTree" class="ztree"></ul>
|
|
|
|
</div>
|
|
|
|
<div id="ztree-detail" style="margin-left: 225px; width: auto;">
|
|
|
|
<table id="test-datagrid-array" data-width="100%" data-height="100%" class="table table-bordered"></table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-10-26 21:58:12 +08:00
|
|
|
|
2015-10-28 22:49:59 +08:00
|
|
|
<script type="text/javascript">
|
2015-10-26 21:58:12 +08:00
|
|
|
|
2015-10-28 22:49:59 +08:00
|
|
|
$(document).ready(function () {
|
|
|
|
|
2015-10-28 23:33:33 +08:00
|
|
|
var setting = {
|
|
|
|
view: {
|
|
|
|
selectedMulti: false
|
|
|
|
},
|
|
|
|
data: {
|
2015-10-29 23:51:10 +08:00
|
|
|
key: {
|
|
|
|
name: "Name",
|
|
|
|
title: "Name"
|
|
|
|
},
|
2015-10-28 23:33:33 +08:00
|
|
|
simpleData: {
|
|
|
|
enable: true,
|
2015-10-29 23:51:10 +08:00
|
|
|
idKey: "Id",
|
|
|
|
pIdKey: "ParentId",
|
2015-10-28 23:33:33 +08:00
|
|
|
rootPId: "null"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
callback: {
|
|
|
|
onClick: zTreeOnClick
|
|
|
|
}
|
|
|
|
};
|
2015-10-28 22:49:59 +08:00
|
|
|
|
2015-10-29 23:51:10 +08:00
|
|
|
$.getJSON("OrgManager/LoadOrg", function (json) {
|
2015-10-28 23:33:33 +08:00
|
|
|
var zTreeObj = $.fn.zTree.init($("#orgTree"), setting, json);
|
2015-10-28 22:49:59 +08:00
|
|
|
|
2015-10-29 23:51:10 +08:00
|
|
|
$('#test-datagrid-array').datagrid({
|
|
|
|
gridTitle: '机构列表显示',
|
|
|
|
showToolbar: true,
|
|
|
|
toolbarItem: 'all',
|
|
|
|
columns: [
|
|
|
|
{ name: 'Name', width: '150', label: '机构名称' },
|
|
|
|
{ name: 'CreateTime', width: '120', label: '登记日期' }
|
|
|
|
],
|
|
|
|
data: json,
|
|
|
|
hiddenFields: ['Id'],
|
|
|
|
editUrl: 'ajaxDone1.html',
|
|
|
|
delUrl: 'ajaxDone1.html',
|
|
|
|
editMode: 'dialog',
|
|
|
|
fullGrid: true,
|
|
|
|
showLinenumber: true,
|
|
|
|
showCheckboxcol: true,
|
|
|
|
paging: false,
|
|
|
|
filterMult: false,
|
|
|
|
showTfoot: true
|
|
|
|
});
|
2015-10-28 22:49:59 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
2015-10-29 23:51:10 +08:00
|
|
|
|
|
|
|
function zTreeOnClick(event, treeId, treeNode) {
|
|
|
|
$.getJSON("OrgManager/LoadChildren", { id: treeNode.Id }, function (json) {
|
|
|
|
$('#test-datagrid-array').destroy();
|
|
|
|
$('#test-datagrid-array').datagrid({
|
|
|
|
gridTitle: '机构列表显示',
|
|
|
|
showToolbar: true,
|
|
|
|
toolbarItem: 'all',
|
|
|
|
columns: [
|
|
|
|
{ name: 'Name', width: '150', label: '机构名称' },
|
|
|
|
{ name: 'CreateTime', width: '120', label: '登记日期' }
|
|
|
|
],
|
|
|
|
data: json,
|
|
|
|
hiddenFields: ['Id'],
|
|
|
|
editUrl: 'ajaxDone1.html',
|
|
|
|
delUrl: 'ajaxDone1.html',
|
|
|
|
editMode: 'dialog',
|
|
|
|
fullGrid: true,
|
|
|
|
showLinenumber: true,
|
|
|
|
showCheckboxcol: true,
|
|
|
|
paging: false,
|
|
|
|
filterMult: false,
|
|
|
|
showTfoot: true
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
2015-10-28 22:49:59 +08:00
|
|
|
//@@ sourceURL=orgIndex.js
|
|
|
|
</script>
|