Page 1 of 1

Report interaction

Posted: Thu Apr 18, 2024 6:50 am
by mono
Hello,

I'm using Report.JS and I'm trying to add javascript interaction to some report components.

I'm using a dataset and displaying it using a table. I need to perform some action when one cell in that table is clicked. Action should depend on what is inside this cell (it should be dynamic). Action is not bound to report, I have to do something with my application outside of the report's view, but I'm interested in "in report" actions as well.

So my question is, can I somehow inject javascript inside the cell that will be executed on click (or some other mechanism to detect click outside of report).



If there is no such mechanism. Is there a way to assign some component (table cell in this case) some kind of identifier (e.g. static HTML class attribute) so I can apply event listener myself using javascript.

I can't find a way to do this. Currently, there is a class attribute set to table cell, but it's some random string. Is there any way to control this, or add some other custom HTML attribute, so I can identify this cell.



If this (or something similar) is possible, can you please provide me with some examples.

Thank you.

Re: Report interaction

Posted: Fri Apr 19, 2024 2:46 pm
by Lech Kulikowski