$("#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();
}
/**初始加载,默认
easyui treegrid 懒加载
最新推荐文章于 2024-06-27 18:03:30 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)