KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Table rowClick event not working #518

Open Tracx opened this topic on on Nov 13, 2018 - 1 comments

Tracx commented on Nov 13, 2018

Hi,

I am using the rowClick event of Table to open a document based on Id field.

I. The rowClick event is not get invoked:

Table::create(array(
    "dataStore"=>$this->dataStore('users'),
    "clientEvents"=>array(
        "rowClick"=>"function(e) { console.log('ok');
            console.log(e.rowIndex);
        }"
    ),
    "showFooter"=>"top",
    "columns"=>array(

II. How to pass Id field to rowClick event so that when row is clicked its unique Id is captured and opens a required document.

Thanks!

Also, we have another ticket open for Export to PDF. Could you please assist on that too. Thank you!

KoolReport commented on Nov 14, 2018

Hi Tracx,

Inside the parameter of rowClick function event, there is "rowData" in which you can get data of your row.

Try this:

"clientEvents"=>array(
    "rowClick"=>"function(e){
        console.log(e);
    }"
)

You will get object containing: rowItem,rowData and table.

If you have your column name is "id", you can get by e.rowData["id"] or you can use the e.rowData[0] if id is the first column in your table.

If the event is not fired, please try to check if there is any loading error related to table at browser. Btw, we have just released the KoolReport 3.0.0, you may upgrade now.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None