$("#treedg").treegrid({
idField:'ID',
treeField:'tree_field',
nowrap:false,
fitColumns:(totalWidth>$(window).width()?false:true),
width:$(window).width(),
height:$(window).height(),
rowStyler:rowStyler,
onBeforeExpand:onBeforeExpand,
onLoadSuccess: function(row,data){
resetColor();
/**easyui:datagrid,treegrid 当列数过大且未加载数据的情况下,超长列不显示,且无滚动条 ,
* 以下为简易解决方案
* */
if(data.length==0){
$(this).treegrid('append',{parent:"",data:[{KPI_ID:"tempRow",COLOR_NUM:-1}]});//一定要给COLOR_NUM,否则行上会给默认颜色
$("tr[datagrid-row-index='0']").css({"visibility":"hidden"});
}
else{
$("tr[datagrid-row-index='0']").remove();
}
/**初始加载,默认