API for Setting Cell Tooltip 

  • Last update:  2022-02-14
  • addEffect

    MethodaddEffect(type, opts)

    A tooltip appears when the mouse hovers over a cell

      Parameter

    type: string,

    opts: {

    address: string,

    text: string,

    image: string

    }

    type:tooltip type,string

    • showTooltip:Text/image tooltip when the mouse hovers over the cell

    opts:tooltip attributes,json format

    1)address:Cell address,string,such as 'A1'

    2)text:Tooltip content,string

    3)image:Picture URL path,string,Picture format support png、jpg. The image source can be a web page image, such as:

    https://www.fanruan.com/images/logo-fanruan.png

    You can also place the picture in the report project directory %FR_HOME%\webapps\webroot and access it through URL. like:

    http://localhost:8075/webroot/11.jpg

    Note: When the image and text attributes exist at the same time, only the text attribute takes effect.

    Return valuevoid
       Example

    Refer to example chapter

    Application

    example

    A tooltip box appears when the mouse hovers over cell A1, and the tooltip content is "OrderID10001":

    See the Examples section for more examples.

    1.gif

    Mobile
    Support mobile terminal

    The following content is an example of the interface, divided into text tooltip and picture tooltip, corresponding to the two values of the type parameter.

    1. Code example

    Example 1: If the obtained report block object is defined as report , a tootltip box will appear when the mouse hovers over cell A2, and the tooltip content is "OrderID10001"

    report.addEffect('showTooltip', {
        address: "A2",
        text: 'OrderID10001'
    });

    Example 2: In a general report, a tootltip box appears when the mouse hovers over cell A2, and the tooltip content is "OrderID10001":

    _g().addEffect('showTooltip', {
        address: "A2",
        text: 'OrderID10001'
    });

    Example 3: In the dashboard, when the mouse hovers over the cell A2 of the report0 report block, a tooltip box appears, and the tooltip content is "OrderID10001":

    _g().getWidgetByName('report0').addEffect('showTooltip', {
    address: "A2",
    text: 'OrderID10001'
    });

    Example 4: If the obtained report block object is defined as report , the words FanRuan log will appear when the mouse hovers over cell A2:

    report .addEffect('showTooltip', {
        address: "A2",
        image:"https://www.fanruan.com/images/logo-fanruan.png"
    });

    Example 5: In a general report, the words FanRuan log appear when the mouse hovers over cell A2:

    _g().addEffect('showTooltip', {
        address: "A2",
        image:"https://www.fanruan.com/images/logo-fanruan.png"
    });

    Example 6: In the dashboard, the words FanRuan log appear when the mouse hovers in cell A2:

    _g().getWidgetByName('report0').addEffect('showTooltip', {
    address: "A2",
    image: "https://www.fanruan.com/images/logo-fanruan.png"
    });


    2. Application example

    Example 1: A  tooltip box appears when the mouse hovers over cell A2, and the tooltip content is "Order ID10001"

    Click to download the template:

    Mouse hover cell text tooltip appear.cpt

    2.gif

    Example 2: The word FanRuan log appears when the mouse hovers in cell A2

    Click to download the template:

    Mouse hover cell picture tooltip appear.rar

    3.gif

    Attachment List


    Theme: Secondary Development
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy