简体   繁体   English

pentaho cde 表组件中的超链接

[英]Hyperlink in pentaho cde table component

I have created a table component in Pentaho in which I add a column with a hyperlink of the format https://www.aaaa.com/id .我在 Pentaho 中创建了一个表组件,我在其中添加了一个带有https://www.aaaa.com/id格式的超链接的列。 It correctly shows in the table.它正确地显示在表中。

Now I want to create another hyperlink in the same table, but it has format https://www.aaaa.com/probe&bbbbb%20&bbb$probe2 .现在我想在同一个表中创建另一个超链接,但它的格式为https://www.aaaa.com/probe&bbbbb%20&bbb$probe2

How can I make it show only the field and not the path?我怎样才能让它只显示字段而不显示路径?

I have achieved something similar but clicking anywhere in the row the page is opened while I want it to only open the hyperlink.我已经实现了类似的功能,但是单击页面打开的行中的任意位置,而我希望它只打开超链接。

you have to write a function under click Action under advance property something like below.您必须在高级属性下的单击操作下编写一个函数,如下所示。 tableData[e.rowIdx][1] is a column name where you have to specify the column where you have to specify the click event. tableData[e.rowIdx][1] 是列名,您必须在其中指定必须指定单击事件的列。

function testClick(e) {
var id = e.tableData[e.rowIdx][1];
window.open('/pentaho/api/repos/%3Apublic%3Asample%3Adashboards%3Aname.wcdf/generatedContent?p_site='+id,"_self");

}

also you can write CSS to put underline and hover change color.您也可以编写 CSS 来放置下划线和悬停更改颜色。

also put below code for all the table columns where you don't want click event.还为您不希望单击事件的所有表列添加以下代码。

#tbl_waste_overviewTable tbody tr td:nth-child(2) {
    pointer-events: none;
}

You should check the column name you want to achieve the click action on as below您应该检查要实现单击操作的列名称,如下所示

function(obj) {
   if(obj.category == 'Desired Column'){

 // perform desired click action below
 }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM