From a54b46964b81489bd6d4d18b10854b62f3003509 Mon Sep 17 00:00:00 2001 From: Mohammad Reza Golestan Date: Sun, 7 May 2023 12:22:14 +0330 Subject: [PATCH 1/2] add exportRender how to use to document (this method added on commit d48dc1bbe8bc860070240d6f1444e7a861c53789 to be used for render column for print or export as we expected) --- html-builder-column-builder.md | 1 + html-builder-column.md | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/html-builder-column-builder.md b/html-builder-column-builder.md index 1f1fd6e..2aba799 100644 --- a/html-builder-column-builder.md +++ b/html-builder-column-builder.md @@ -31,6 +31,7 @@ $column = Column::make('id') ->searchable(true) ->orderable(true) ->render('\'
\' + (full[\'deleted_at\'] == null ? \'Active\' : \'Inactive\') + \'
\';\'\'' ) + ->render(function($row,$data){return $data == 1 ? 'Active' : 'Inactive'}) ->footer('Id') ->exportable(true) ->printable(true); diff --git a/html-builder-column.md b/html-builder-column.md index ab21bf4..f0a2b03 100644 --- a/html-builder-column.md +++ b/html-builder-column.md @@ -47,6 +47,10 @@ Orderable attribute will toggle the `ordering` ability for the defined column. D ### Render (Optional) Render attribute is a `js` script string that you can use to modify the way the column is being rendered via `javascript`. +### Export Render (Optional) +Export Render attribute is a `php callback function` that you can use to modify the way the column is being rendered via `print` or `export (CSV/Excel/PDF)`. + + ### Footer (Optional) Footer attribute will be as your `tables` column's `footer` content ``. From 39cd19626d28a5998fd50b127aa9e4b5469c1d48 Mon Sep 17 00:00:00 2001 From: Mohammad Reza Golestan Date: Mon, 31 Jul 2023 15:00:57 +0330 Subject: [PATCH 2/2] add exportRender --- html-builder-column-builder.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html-builder-column-builder.md b/html-builder-column-builder.md index 2aba799..ddaff77 100644 --- a/html-builder-column-builder.md +++ b/html-builder-column-builder.md @@ -31,7 +31,7 @@ $column = Column::make('id') ->searchable(true) ->orderable(true) ->render('\'
\' + (full[\'deleted_at\'] == null ? \'Active\' : \'Inactive\') + \'
\';\'\'' ) - ->render(function($row,$data){return $data == 1 ? 'Active' : 'Inactive'}) + ->exportRender(function($row,$data){return $data == 1 ? 'Active' : 'Inactive'}) ->footer('Id') ->exportable(true) ->printable(true);