有冻结列的报表点击行变色效果

帆软社群问答顾问; 入选2022年帆软产品致谢名单;
话接一篇文档:JS实现鼠标点击行变色
有蕃署提问说,带有冻结列的情况下,点击行变色,会被截断,像这样: 截图202104141543397068.png 截图202104141543526710.png
此帖可解决这个问题
设置重复冻结列:
截图202104141545276485.png
然后在模板web属性中的分页预览中添加加载结束事件:
  1. $(".x-table tr").mousedown(function() {
  2.         if (this.id !== 'r-0-0') {
  3.                 var row = $(this).attr("tridx")
  4.                 $(".x-table tr").each(function() {
  5.                         if (this.id !== 'r-0-0') {
  6.                                 if (row != $(this).attr("tridx")) {
  7.                                         $(this).children("td").each(function() {
  8.                                                 $(this).css("background-color", 'white');
  9.                                         });
  10.                                 } else {
  11.                                         $(this).children("td").each(function() {
  12.                                                 $(this).css("background-color", 'rgb(255, 255,0)');
  13.                                         })
  14.                                 }
  15.                         }
  16.                 });
  17.         }
  18. });
复制代码
预览后效果:



编辑于 2021-4-20 11:01  
参与人数 +1 F豆 +2 理由
masonlu + 2 太棒了,给你32个赞,么么哒

查看全部评分

发表于 2022-5-7 15:19:57
这个可以解决冻结问题,那如果,同时也分多个sheet页呢?怎么写呢?
发表于 2023-2-2 11:09:59
大佬给力
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

2回帖数 1关注人数 20561浏览人数
最后回复于:2023-2-2 11:09

返回顶部 返回列表