treegrid 动态隐藏列
Posted albert_think
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了treegrid 动态隐藏列相关的知识,希望对你有一定的参考价值。
function getShorMonths(){
var d = new Date();
var str = d.getFullYear()+"-"+(d.getMonth()+1);
var arr=["2018-12","2018-11","2018-10","2018-09","2018-08","2018-07","2018-06","2018-05","2018-04","2018-03","2018-02","2018-01","2017-12","2017-11","2017-10","2017-09","2017-08","2017-07","2017-06","2017-05","2017-04","2017-03","2017-02","2017-01","2016-12","2016-11","2016-10","2016-09","2016-08","2016-07","2016-06","201-605","2016-04","2016-03","2016-02","2016-01"];
$.each(arr,function (index,d){
var stdt=new Date(str);
var etdt=new Date(d);
if(etdt>stdt){
var h="p"+d.replace("-","");
$(‘#dw‘).treegrid(‘hideColumn‘, h);
}
});
}
以上是关于treegrid 动态隐藏列的主要内容,如果未能解决你的问题,请参考以下文章