实时报表页面重写自定义列功能

This commit is contained in:
wangxin
2018-07-12 14:35:53 +08:00
parent cc61430930
commit fabfc87741

View File

@@ -124,6 +124,45 @@ var ajaxReport=function(url,target){
}
});
};
//自定义列设置事件
function customColumnClick(){
var submit = function(v,h,f) {
var abVisCols = [true];
top.$(".customColumnList input[type='checkbox']").each(function(){
abVisCols[$(this).val()] = $(this).prop("checked");
});
var key = getLocationPathName()+"_visCols";
Cookies.set(key,JSON.stringify(abVisCols),{expires:7});
customColumnInit();
return true;
}
var html = "<div class='customColumnList'>";
$(".active .table tr th").each(function(colIndex,obj){
if(colIndex==0) { //第一列th含 checkbox ,结束本次循环, 下标从1开始反之0开始
var ckVal = $(this).find("input[type='checkbox']").val();
if(typeof(ckVal) != "undefined") {
return true;
}
}
if($(this).hasClass("cfgDesc")){
return true;
}
var checked = ($(this).is(":visible") ? "checked='checked'":"");
var ckbox_html = "<input type='checkbox' "+checked+" value='"+colIndex+"'/>";
html+="<div class='col-md-6'><label>"+ckbox_html+" "+$(this).html()+"</label></div>";
})
html +="</div>";
top.$.jBox(html,{title:"<i class='fa fa-wrench'></i> Custom Columns",showIcon:false,opacity:0.3,submit:submit});
}
</script>
</head>
<body>