I am trying to make the table component with the button inside the table column in CDE Pentaho. How can it be achieved?
-
@Pamblam: where to write this code for table component in pentaho CDE? – paudel.sulav Jan 21 '16 at 05:28
-
oh you know, in the middle somewhere. – I wrestled a bear once. Jan 21 '16 at 05:43
-
please give the proper solution. – paudel.sulav Jan 21 '16 at 05:46
2 Answers
I guess it will need some work. In the Draw function of your table, you may put some javascript to manipulate the DOM and add your button : as far as I remember, the draw function receives a parameter that is a structure with the column and row index of the current cell.
Try first this code in the draw function :
function(paramdraw) {
console.log(paramdraw);
}
and look for the content of paramdraw iin the console.
Maybe there is a better way to do it...

- 667
- 4
- 13
-
I didn't saw any draw function in my table component of CDE pentaho. Where can I find that? – paudel.sulav Jan 21 '16 at 14:43
-
What we do here usually is something like editing the query on the datasource with a column that output the HTML code for a button.
SELECT
ID,
NAME,
concat('<input type="button" onclick="alert(',ID,')">click me</input>') as button
FROM
foo
WHERE
bar='bar';
That should display a button. If you are not using a query as datasource, but a transformation the idea is the same. Just make the output contains a string that when interpreted by the browser is a button.
Hope it helps. =)

- 383
- 3
- 10