-
-
Couldn't load subscription status.
- Fork 56
Add export PDF with post as a method. #42
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
Conversation
change exportPostPdf to postPdf
sample code would be
public function html() { return $this->builder() ->columns($this->getColumns()) ->parameters([ 'buttons' => ['postPdf'], ]); }
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');
Please solve conflict / remove the same script found on #41 as it was already merged. Thanks!
Done for fixing conflict. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this back to meta.
Change to $('meta[name="csrf-token"]').attr('content')
Use exportPostPdf as button. This button is recommended for IE browsers since IE has URL length limit.