From d48dc1bbe8bc860070240d6f1444e7a861c53789 Mon Sep 17 00:00:00 2001 From: Mohammad Reza Golestan Date: Sun, 7 May 2023 11:49:16 +0330 Subject: [PATCH 1/2] add exportRender method to be used in datatable-buttons for render print + exports as expected --- src/Html/Column.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Html/Column.php b/src/Html/Column.php index e4818ce..8e157a5 100644 --- a/src/Html/Column.php +++ b/src/Html/Column.php @@ -491,6 +491,20 @@ public function render(mixed $value): static return $this; } + /** + * Set Callback function to render column for Print + Export + * + * @param function $callback + * @return $this + + */ + public function exportRender(callable $callback): static + { + $this->attributes['exportRender'] = $callback; + + return $this; + } + /** * Parse render attribute. * From dea7bb24d7becae3d4216760f488d52bbeb311a5 Mon Sep 17 00:00:00 2001 From: Mohammad Reza Golestan Date: Mon, 8 May 2023 10:24:04 +0330 Subject: [PATCH 2/2] add exportRender method to be used in datatable-buttons for render print + exports as expected: bugfix for static analysis with phpstan --- src/Html/Column.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Html/Column.php b/src/Html/Column.php index 8e157a5..61cc1b2 100644 --- a/src/Html/Column.php +++ b/src/Html/Column.php @@ -494,7 +494,7 @@ public function render(mixed $value): static /** * Set Callback function to render column for Print + Export * - * @param function $callback + * @param callable $callback * @return $this */