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

[3.0] Implemented the 'exclude column from export' #65

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 8 commits into yajra:3.0 from rylxes:excluded-columns
Aug 15, 2018

Conversation

@rylxes
Copy link
Contributor

@rylxes rylxes commented Jul 5, 2018
edited
Loading

you can just add the columns you do not want to be exported using

protected $excludeFromExport = ['column_name'];

in the model's Datatable

yajra reacted with thumbs up emoji
@yajra yajra changed the title (削除) implemented the 'exclude column from export' (削除ここまで) (追記) [3.0] Implemented the 'exclude column from export' (追記ここまで) Jul 6, 2018
Copy link
Owner

yajra commented Jul 6, 2018

Can you please remove the .idea files that were added.

$orientation = config('datatables-buttons.snappy.orientation');

$snappy->setOptions($options)
->setOrientation($orientation);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this indention.

->setOrientation($orientation);

return $snappy->loadHTML($this->printPreview())
->download($this->getFilename() . '.pdf');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this indention.

Copy link
Contributor Author

rylxes commented Jul 6, 2018

made the changes as requested

Copy link
Owner

@yajra yajra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the excess new line to fix the failing StyleCI. Thanks!

*/
protected $dataTableVariable = 'dataTable';


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the excess new line.

return is_array($this->printColumns) ? $this->printColumns : $this->getFilteredColumnsFromBuilder();
}


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the excess new line.

return $this->html()->removeColumn(...$this->excludeFromExport)->getColumns();
}


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the excess new line.

Copy link
Owner

yajra commented Jul 6, 2018

Just wondering, since we only aim to exclude from export, I think we should not touch the print columns or better, create a separate handler for it? What do you think?

Copy link
Contributor Author

rylxes commented Jul 6, 2018

i think creating a separate handler for it would be nicer

Copy link
Owner

@yajra yajra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little typo and I think this is good to go. Thanks!

}

/**
* Get filtered print columns definition from html builder.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get filtered export columns definition from html builder.

Copy link
Contributor Author

rylxes commented Jul 10, 2018

Done

@yajra yajra merged commit 32c051d into yajra:3.0 Aug 15, 2018
Copy link
Owner

yajra commented Aug 15, 2018

Released on v3.3.0, thanks!

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

Reviewers

@yajra yajra yajra approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

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