It just shows the loading for a couple seconds and does nothing.
Could this problem be related to it being inside a FlexView within the content function?
When I click an export button, I get this in the Network inspect tool:
{"panels":[],"scripts":["KoolReport.dashboard.dboard.setState({\"ArchiveDocQtdA\":{\"detailModalParams\":[]}});"]}
What I did was:
I have copy/paste the detailModal from TDefaultModal.php and added the buttons
protected function detailModal($params = [])
{
$modal = Modal::create();
$dataView = $this->dataView();
return $modal
->title(Lang::t("Details"))
->type("info")
->size("lg")
->sub([
Table::create($this->name() . "DetailTable")
->pageSize(10)
->dataSource($dataView->data())
->fields(function () use ($dataView) {
//We need to copy columns like this because
//of extra fields only be set at creation of fields
//The fields here is for Google Chart and
//may not be use inside Table
return array_map(
function ($field) {
return $field->clone();
},
$dataView->fields()
);
})
])
->footer([
Button::create()
->text("Exportar CSV")
->type("primary")
->icon("fa fa-file-csv")
->onClick(
Client::showLoader().
Client::widget($this->name() . "DetailTable")->exportToCSV()
),
Button::create()
->text("Exportar PDF")
->type("primary")
->icon("far fa-file-pdf")
->onClick(
Client::showLoader().
Client::widget($this->name() . "DetailTable")->exportToPDF()
),
Button::create()
->text(Lang::t("Done"))
->type("success")
->onClick(Modal::hide($modal))
]);
}
And turned feature on:
ArchiveDocQtdA::create()
->detailShowable(true)
->pdfExportable(true)
->csvExportable(true),