Skip to content

Conversation

@ejgandelaberon
Copy link
Contributor

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');
                })
            ]);
    }
}

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 4, 2024

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

yajra commented Sep 5, 2024

@OzanKurt
Copy link
Contributor

OzanKurt commented Sep 9, 2024

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

Thanks @ejgandelaberon !

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants