yajra / laravel-datatables-buttons

Laravel DataTables Buttons Plugin
https://yajrabox.com/docs/laravel-datatables/buttons-installation
MIT License
254 stars 53 forks source link

Print Specific Columns. How can I get $excludeFromPrint=[] array value dynamically from colvis. I am using InfyOm generator and Yajra Datatable #176

Open skabirgithub opened 1 year ago

skabirgithub commented 1 year ago

Summary of problem or feature request

Print Specific Columns. How can I get $excludeFromPrint=[] array value dynamically from colvis. I am using InfyOm generator and Yajra Datatable

Code snippet of problem

protected $excludeFromPrint = [];

protected function getPrintColumnsFromBuilder()
{
    return $this->html()->removeColumn(...$this->excludeFromPrint)->getColumns();
}

System details

yajra commented 1 year ago

Quick answer, not supported as the colvis button does not support server-side implementation afaik.

However, I think you can create a custom button for this. See https://github.com/yajra/laravel-datatables-buttons/blob/master/src/resources/assets/buttons.server-side.js#L160 for reference.