Connie Chen
Connie Chen

Reputation: 113

Pentaho CDE Pop up component for data table columns

I want to make pop up windows for each columns in my table component to explain where the numbers in this column come from. The link below is a example of pop up on pie chart. Does anyone know how to do it in a data table?

Popup Component Example in pentaho CDE - Popup on Pie & in the popup showing bar chart or any other CDE component

Upvotes: 1

Views: 2069

Answers (1)

Lucas Gomes
Lucas Gomes

Reputation: 1539

EDIT 2017:

I'd like to present another way (maybe a better way) to access the rows in a table. Now what I am doing is this:

Dashboards.fireChange('my_variable',e.tableData[e.rowIdx][column_index]);

e.rowIdx returns the index for the row I am clicking. When I use e.tableData[e.rowIdx], I am able to get all the columns in that row, and knowing what column gives me the desired value, I can access it using the column index.

Original post:

I'll relate my experience. I have one table that, when I click in a row, executes another query in my dashboard. What I did, and I don't know if this is the best way of doing it, was executing a javascript code when I click on the table, and check if the column clicked is the one I need the information from.

In the table component's "clickAction" property, I have this js:

function f(e){ 
    if(e.category == 'COLUMN_NAME_DESIRED')
    {
        Dashboards.fireChange('my_variable', e.value);
    }
} 

And I have another table component listening to 'my_variable'. So, when the value changes, the dashboard loads this other component.

In your specific case, I would do this:

function f(e){ 
    if(e.category == 'COLUMN_NAME_1')
    {
        alert('this row represents X');
    }
    if(e.category == 'COLUMN_NAME_2')
    {
        alert('this row represents Y');
    }
} 

Now, if you want to use a pop-up dialog and not a js:alert, look for some css examples. I think it would help you.

Upvotes: 1

Related Questions