You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public function setUp(): array
{
$isExportAllowed = true;
// Additional logic to determine if export is allowed goes here...
return [
Exportable::make('export-table')
->striped()
->type(Exportable::TYPE_XLS, Exportable::TYPE_CSV)
->can($isExportAllowed),
Header::make()
->showSearchInput()
->showToggleColumns(),
Footer::make()
->showRecordCount()
];
}
If the ->can() method resolves to false, it could just not render the Export button.
I'm not sure if this feature is possible, but I just thought it might add some convenience for anyone that needs to conditionally render the Export button.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a project in which only certain users will have access to Export a table, and any other type of user should not be able to export.
Currently, I am modifying the setup function like this to allow this functionality:
This works, but could be nice if it had similar functionality as Row Action Buttons ( https://livewire-powergrid.com/table/row-actions-buttons.html#can ) and could be written like this instead:
If the
->can()
method resolves tofalse
, it could just not render the Export button.I'm not sure if this feature is possible, but I just thought it might add some convenience for anyone that needs to conditionally render the Export button.
Beta Was this translation helpful? Give feedback.
All reactions