KoolReport's Forum

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

Datatable With Modal #995

Open branden opened this topic on on Jul 18, 2019 - 3 comments

branden commented on Jul 18, 2019

Hi, i want to know if its possible to add a button for each record on a DataTable with a modal popping up.

KoolReport commented on Jul 19, 2019

Are you using datagrid package?

branden commented on Jul 22, 2019

Yes i am using the datagrid package

KoolReport commented on Jul 24, 2019

You can use formatValue to put button into DataTables:

DataTables::create(array(
    "columns"=>array(
        "your-column-name"=>array(
            "formatValue"=>"<button onclick='openModal(@value)'>View</button>"
        )
    )
))

Now you can write your own openModal() function:

function openModal(param)
{
    ...
}

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
help needed

DataGrid