diff --git a/src/Type/DataTableType.php b/src/Type/DataTableType.php index 0cbab196..19ee0966 100755 --- a/src/Type/DataTableType.php +++ b/src/Type/DataTableType.php @@ -371,7 +371,11 @@ private function createExportHeaderRowView(DataTableView $view, DataTableInterfa private function createExportValueRowsViews(DataTableView $view, DataTableInterface $dataTable, array $columns): iterable { - $items = $dataTable->getQuery()->getItems(); + if ($dataTable->getConfig()->isPaginationEnabled()) { + $items = $dataTable->getPagination()->getItems(); + } else { + $items = $dataTable->getQuery()->getItems(); + } foreach ($items as $index => $data) { $valueRowView = new ValueRowView($view, $index, $data);