Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: fast excel export via Column's exportRender() #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
yajra merged 2 commits into yajra:master from ejgandelaberon:master
Sep 5, 2024

Conversation

@ejgandelaberon
Copy link
Contributor

@ejgandelaberon ejgandelaberon commented Sep 4, 2024

Since this pull request, per cell styling is supported via exportFormat() of Column class.

This pull request takes it further by supporting the exportRender() of Column when using fast excel to provide another way to modify cell data.

Usage

class YourDataTable extends DataTable
{
 protected bool $fastExcel = true;
 
 public function html()
 {
 return $this->builder()
 ->columns([
 \Yajra\DataTables\Html\Column::make('created_at')->exportRender(function ($row, $data) {
 return \Carbon\Carbon::parse($data)->format('m/d/Y h:i a');
 })
 ]);
 }
}

Copy link

sonarqubecloud bot commented Sep 4, 2024

@yajra yajra merged commit b9a36aa into yajra:master Sep 5, 2024
Copy link
Owner

yajra commented Sep 5, 2024

Copy link
Contributor

OzanKurt commented Sep 9, 2024

Great update, I was using if (request('action') === 'excel') to modify editColumns.

Thanks @ejgandelaberon !

ejgandelaberon reacted with rocket emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /