KoolReport's Forum

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

Data table click element drilldown #1444

Closed ankit raj opened this topic on on May 18, 2020 - 3 comments

ankit raj commented on May 18, 2020

Hello i have a datatable on which i am implementing a click event on any individual element of the table which will open a new popup based on the row/column from where it was clicked. how do i send a callback on click along with extra data which includes other column details of the same row,basically on every click i want to send the first column element to backend as identifier to drilldown?

ankit raj commented on May 18, 2020

So basically , I need to render a datatable and there should be a link on one of the columns on click of which i need to call a js function with the properties of the row clicked

KoolReport commented on May 18, 2020

You may use column formatValue to generate link, for example:

DataTables::create(array(
    "columns"=>array(
        "myColumn"=>array(
            "formatValue"=>function($value,$row) {
                return "<a href='javascript: myCustomFunction("+$row["customerNumber"]+")'>Action</a>";
            }
        )
    )
));
ankit raj commented on May 21, 2020

Thanks a lot

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

DataGrid