试了下,好像加载结束后获取不到后面sheet单元格的值
我把其他sheet的单元格放到第一个来取,然后和当前时间的日期进行比较得出来,给sheet字体变颜色,代码如下(放在模板web属性-填报设置-加载结束事件中),你看下能不能参考:
var date = new Date();
var year = date.getFullYear();
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month = 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = year + month + strDate;
var s1=contentPane.getCellValue(0,1,0).replace(/-/g,"")
var s2=contentPane.getCellValue(0,2,0).replace(/-/g,"")
var s3=contentPane.getCellValue(0,3,0).replace(/-/g,"")
if(s1<currentdate){
$(".fr-sheetbutton-middlepart")[0].style.color="red"
}
if(s2<currentdate){
$(".fr-sheetbutton-middlepart")[1].style.color="red"
}
if(s3<currentdate){
$(".fr-sheetbutton-middlepart")[2].style.color="red"
}
sheet变红.cpt