Skip to content

Conversation

@jiwom
Copy link
Contributor

@jiwom jiwom commented Oct 27, 2017

Use exportPostExcel as button. This button is recommended for IE browsers since IE has URL length limit.

@jiwom
Copy link
Contributor Author

jiwom commented Oct 27, 2017

change exportPostExcel to postExcel

sample code would be

public function html()
    {
        return $this->builder()
                    ->columns($this->getColumns())
                    ->parameters([
                        'buttons'      => ['postExcel'],
                    ]);
    }

Take note of adding CSRF token

<meta name="csrf-token" content="{{ csrf_token() }}" />
<script type="text/javascript">
$.ajaxSetup({
    headers: {
        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
    }
});
</script>

Take note of your Routing

$router->post('sample/export', SampleController::class . '@index');

@yajra
Copy link
Owner

yajra commented Oct 27, 2017

Please solve conflict / remove the same script found on #41 as it was already merged. Thanks!

@yajra yajra merged commit b2f9bbd into yajra:3.0 Oct 27, 2017
@yajra
Copy link
Owner

yajra commented Oct 27, 2017

Please also submit a PR on docs if possible. Thanks!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants