Link hyperlinke type
In the daily data analytics process, we often encounter some data that needs to be consulted in detail, and these details are usually on another page or site. In this case, if the relevant links can be embedded directly into the table, the work efficiency of data analytics will be greatly improved. VTable achieves this requirement through the configuration of the link hyperlinke type.
Hyperlinke type specific configuration
Next, we will explain the configuration items unique to the link type one by one:
-
linkJumpThe default value istrueIf this istrueThe link will be clickable to jump to the specified address; iffalse, the link will not have a jump function and will only be displayed in text form. -
linkDetectThe default value istrueWhen set totrueThe program will check the links regularly, and only links that meet the URL rules will be displayed as clickable hyperlinkes. For template link types, this configuration item does not take effect. -
templateLinkUsed to define template link addresses. For example, configure to'https://www.google.com.hk/search?q={name}, in whichnameIs the field name of the data source property. This makes it easier to quickly generate link addresses.templateLinkcan also be a function(record, col, row, table) => string,recordis the data record,colis the column index,rowis the row index,tableis the table instance.
Example of hyperlinke in table display
Next, we use a concrete example to show how the link type can be applied to a table.
Suppose we have a list of users that contains the user's name, birthday, details link, etc. We want to display this information in the table and quickly jump to the corresponding page when viewing the details. To do this, we can configure ListTable like this:
In this configuration, we include name,birthdate and profile_url Field. Where profile_url字段被设置为 link 类型,并且开启了linkJump和linkDetect 'configuration. This way, when we view the table, we can see that the link to the details is displayed correctly in the cell, and we can click directly to the details page.