Hi Koolreport,
I am generating my report with Datatable and want to display the child row in a dialog box when clicked instead of expanding below. I am referring to this https://datatables.net/extensions/responsive/examples/display-types/modal.html. How do I achieve this in Koolreport?
Below is my code
DataTables::create([
"dataSource" => $this->dataStore("mytable"),
"name"=>"mainTable",
"columns" => [
"first_name" => [
"label" => "First Name"
],
"last_name" => [
"label" => "Last Name"
],
"date_of_birth" => [
"label" => "DOB"
]
],
"cssClass" => [
'td' => 'center-align'
],
'rowDetailData' => function ($row) {
return
'<table id="subTable">' .
'<thead>' .
'<tr>'.
'<th>Parent Name</th>' .
'<th>Email</th>' .
'</tr>'.
'</thead>' .
'<tbody>' .
'<tr>'.
'<td>' . $row['parent_name'] . '</td>' .
'<td>' . $row['parent_email'] . '</td>' .
'</tr>'.
'</tbody>' .
'</table>';
},
"options" => [
"paging" => TRUE,
"searching" => TRUE,
"pageLength" => 10,
"dom" => 'Bfrtip',
"buttons" => [
"copy", "csv", "excel", "pdf", "print", "colvis"
]
],
"plugins" => ["Buttons"],
]);