app/Http/Livewire/Datatable.php: change setTrashedColumns() into setTrashed().
This commit is contained in:
parent
0d05f3adbe
commit
b012f2b6bc
1 changed files with 11 additions and 4 deletions
|
|
@ -82,7 +82,7 @@ class Datatable extends Component
|
|||
$this->delete_enabled = (bool) $delete_enabled;
|
||||
$this->restore_enabled = (bool) $restore_enabled;
|
||||
|
||||
$this->setTrashedColumns();
|
||||
$this->setTrashed(false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -165,14 +165,21 @@ class Datatable extends Component
|
|||
return view('livewire.datatable', ['items' => $items]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle trashed flag
|
||||
*/
|
||||
public function toggleTrashed()
|
||||
{
|
||||
$this->trashed = !$this->trashed;
|
||||
$this->setTrashedColumns();
|
||||
$this->setTrashed(!$this->trashed);
|
||||
}
|
||||
|
||||
private function setTrashedColumns()
|
||||
/**
|
||||
* Set trashed flag.
|
||||
*/
|
||||
public function setTrashed($value)
|
||||
{
|
||||
$this->trashed = (bool) $value;
|
||||
|
||||
if ($this->trashed) {
|
||||
// Add deleted_at columns.
|
||||
$this->columns['deleted_at'] = 'Deleted at';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue