Pentaho

 View Only

 Column in table component as hyperlink

  • Pentaho
  • Ctools
  • Pentaho
Glupe Registracije's profile image
Glupe Registracije posted 10-30-2018 14:45

Hi,

I am trying to set a table column as hyperlink. To do so, I have used this link: Hitachi Vantara Pentaho - BI Suite Tutorials: Hyperlink for Table columns in pentaho CDE

The example provided on this link works, but clicking anywhere in the row click action is triggered.

Is there a way to limit click action only to particular column(s)?

Regards.


#Ctools
#Pentaho
Luciano Donazzolo's profile image
Luciano Donazzolo

InTable Component, specify "Column Types" setting 'hyperlink' in the right column ('string' in the rest).

This way, each cell value of that column becomes a link.

I never went further, but you can customize a lot more, configuring the Table Component AddIn (ref. Pubic/plugin-samples/CDE/CDE Reference/AddIn Reference).

Hope this may help

Luciano

Glupe Registracije's profile image
Glupe Registracije

Hyperlink column type works only if in the cell is complete link, which is usually not our case.

Often we have some value on which when clicked we would like to go to the certain web page.

Let's say that we have some numeric value, and when you click it, we would like to go to the some google maps location.

Luciano Donazzolo's profile image
Luciano Donazzolo

I see.

I don't know how to use the specific table component addin.

Anyhow I think you could resolve your issue, coding into your table component PostFetch, something like the example that follows (I added a column in the dataset and used the new column to hold a link).

function f(data)

{   var newColIdx=data.metadata.length;

    var colonna={};

    colonna.colName="Link";

    colonna.colType="String";

    colonna.colIndex=newColIdx;

    data.metadata.push(colonna);

    data.resultset.forEach(

        function(row)

        {    row[newColIdx]="<a href='http://www.google.it'>go to google</a>";

        }

    );

    return data;

}

Luciano