如何为xe:dashboard和xe:carousel控件禁用“仪表板”和“轮播”默认工具提示?

问题描述 投票:0回答:1

当悬停在xe:dashboard和xe:carousel控件上时,我试图禁用自动显示的“仪表板”和“轮播”工具提示。

enter image description here

我确实尝试添加以下scriptBolck,但仍得到工具提示

    <xp:scriptBlock id="scriptBlock2">
        <xp:this.value><![CDATA[// disable tooltips
           $(document).ready(function(){
              console.log("IN $(document).ready(function(){ ");
              $('[rel=tooltip]').tooltip()          // Init tooltips
              $('[rel=tooltip]').tooltip('disable') // Disable tooltips
              $('[rel=tooltip]').tooltip('enable')  // (Re-)enable tooltips
              $('[rel=tooltip]').tooltip('destroy') // Hide and destroy tooltips
       });]]></xp:this.value>
    </xp:scriptBlock>
xpages xpages-extlib
1个回答
1
投票

这不是工具提示,而是带有xspDashboard类的包含div上的title属性:

<div id="view:_id1:layout:contentPanel:dashboardPanel:mainDashboard" class="row xspDashboard" style="background-color: #eeeeee;border-radius: 8px;" title="Dashboard" role="presentation"><div class="xspDashboardInner">

标题设置在DashboardRenderer.java line 163中。我尝试使用xe:dashboard上的title属性设置另一个标题,但这不会更改属性,而是直接打印出标题文本,如您在源代码的第161行中所见。我相信这是一个错误,因为渲染器使用w.writeText(boardTitle,null);而不是w.writeAttribute(“ title”,boardTitle,null);。

作为解决方法,您可以像这样清除标题:

$('.xspDashboard').attr("title", "")
© www.soinside.com 2019 - 2024. All rights reserved.