问:如何实现填报报表的悬浮和点击变色?

image.png

FineReport 数字化转型的学习者和实践者 发布于 2024-1-16 17:37
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共2回答
最佳回答
0
yzm163059Lv3见习互助
发布于2024-1-16 18:08(编辑于 2024-1-16 18:12)

加载结束事件添加以下js

//表头为2行

//鼠标点击该行背景色变化

$(".x-table tr").mousedown(function() {  

    // 检查行的id,排除第一行(表头)和第二行(另一个表头)  

    if (this.id !== 'r-0-0' && this.id !== 'r-1-0'    ) {  

        var row = $(this).attr("tridx");  

        $(".x-table tr").each(function() {  

            // 同样排除第一行和第二行  

            if (this.id !== 'r-0-0' && this.id !== 'r-1-0'   ) {  

                if (row !== $(this).attr("tridx")) {  

                    $(this).children("td").each(function() {  

                        $(this).css("background-color", 'white');  

                    });  

                } else {  

                    $(this).children("td").each(function() {  

                        $(this).css("background-color", '#e6ecfe');  

                    });  

                }  

            }  

        });  

    }  

});

鼠标悬浮显示  正在单元格添加公式 按照图片设置"<span style='white-space: nowrap;text-overflow:ellipsis; overflow:hidden; display: inline-block;width:100%;'>"+$$$+""

最佳回答
0
用户k6280494Lv6资深互助
发布于2024-1-17 08:46
  • 3关注人数
  • 242浏览人数
  • 最后回答于:2024-1-17 08:46
    请选择关闭问题的原因
    确定 取消
    返回顶部