树形表格+底部合计+点击列可编辑
<form id="controlNum_sgjf_list_form" class="form-horizontal" method="post" enctype="multipart/form-data">
<table class="bs_table" id="controlNum_sgjf_list_table"></table>
<div id="controlNum_sgjf_list_num_table"></div>
</form>
<script type="text/javascript">
$(function(){
var xmzt='1';
var changeId="";
saveparameters = {
"successfunc" : null,
"url" : 'clientArray',
"extraparam" : {},
"aftersavefunc" : null,
"errorfunc": null,
"afterrestorefunc" : null,
"restoreAfterError" : true,
"mtype" : "POST"
};
var $tableC = $("#controlNum_sgjf_list_table");
$tableC.jqGrid({
url:path+"/xmk/sanGongControlNumController/getSanGongControlNum.do",
ExpandColumn:"INCODE", // 指定某列用于展开表格
height:"auto", //高度自适应
rowNum : "-1",
scrollrows:true,
treeGrid:true,
shrinkToFit : false,
autowidth: true,
treedatatype:"json",
treeGridModel:"adjacency", //treeGrid模式,跟json元数据有关 ,adjacency/nested
loadonce:true,
ExpandColClick:true,
treeReader:{
"parent_id_field":"PARENT_ID",
"level_field":"ORG_LEVEL", // 树的等级根节点为0,依次递增
"leaf_field":"isLeaf", // 是否是子节点
"expanded_field":"expanded", // 是否展开
"loaded":"loaded", //是否异步加载
"icon_field":"icon",
"sort_field":"INCODE" //指定字段排序
},
datatype:"json",
styleUI : 'Bootstrap',
postData:{ywzt:xmzt},
colModel:[
{name:'ID',label:'ID',index:'ID', hidden:true,key:true,frozen: true,editable:true},
{name:"INCODE",label:"单位编码",index:"INCODE"},
{name:"NAME",label:"单位名称",index:"INCODEORNAME",align:'center'},
{name:"XYJE",label:"现有金额",index:"XYJE",align:'center',formatter:function(value,options,row){return formatCurrency(value);}},
{name:"SGJFKZJE",label:"控制金额",index:"SGJFKZJE",align:'center',editable:true,formatter:function(value,options,row){return formatCurrency(value);}},
{name:"YEAR",hidden:true,label:"年度",index:"YEAR",align:'center'},
${ysndlb}
{name:"KZREMARK",label:"控制说明",index:"KZREMARK",align:'center',editable:true},
{name:"BZ",label:"备注",index:"BZ",editable:true,align:'center'},
],
footerrow: true,//是否显示表尾行,表尾是一空白行
gridComplete: completeMethod,//底部合计列
useFooter : true,
// userDataOnFooter: true,//是否将返回来的表尾数