Successfully!

Error!

You are viewing 10.0 help doc. More details are displayed in the latest help doc

Set Cell Tooltip Interface

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: 11.0 New Features
Already the First
Already the Last
  • Helpful
  • Not helpful
  • Only read

Doc Feedback