JS 文字ヒントを改行で表示

  • 作成者:ayuan0625
  • 編集回数:4次
  • 最終更新:ayuan0625 于 2020-12-28
  • I. Overview

    1.1 Problem Description

    If using Finereport's default tooltip of cell, the text in the tooltip cannot be displayed in multiple lines, as shown in the following screenshot:

    1609119182692148.png

    With JavaScript, it is necessary to let text be wrapped in tooltip, as shown in the following screenshot:

    1609119226590742.png


    1.2 Solution

    Use the title attribute of JavaScript.

    II. Demo

    2.1 Data preparation

    Create a new report and new dataset ds1.

    SQL statement of ds1:

    SELECT * FROM Sales_Volume where Region = 'East China'

    1609119259890223.png  


    2.2 Design report

    1) Design the report as follows:

    2) In the menu bar, select Template > Web Attributes. In Pagination Preview tab,

    add a Loading End event, and the JS code is:

    $("td[id^=B1-]").attr("title","Statistics show sales still in service at the end of the month.\nContains sales resigned on the last day of the month");

    2.3 View results

    Save report,select Pagination Preview,and the results are as shown below:

    1.gif

    Tips:Not support mobile devices.

    III. Completed Template

    Attachment List


    Theme: FineReport カスタム開発
    • いいね
    • 良くない
    • 閲覧しただけ