Skip to content

Commit

Permalink
Minor tweaks to blades for reorder cols (#1411)
Browse files Browse the repository at this point in the history
  • Loading branch information
lrljoe authored Oct 13, 2023
1 parent 9d42d0f commit 31ae8fe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
13 changes: 4 additions & 9 deletions resources/views/components/table/tr/footer.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,9 @@
@foreach($this->getColumns() as $colIndex => $column)
@continue($column->isHidden())
@continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column))
@continue($column->isReorderColumn() && !$this->getCurrentlyReorderingStatus())

@if($column->isReorderColumn())
<x-livewire-tables::table.td.plain :column="$column" :displayMinimisedOnReorder="false" wire:key="{{ $tableName .'-footer-'.$colIndex.'-show' }}" :customAttributes="$this->getFooterTdAttributes($column, $rows, $colIndex)" />
@else
<x-livewire-tables::table.td.plain :displayMinimisedOnReorder="true" wire:key="{{ $tableName .'-footer-shown-'.$colIndex }}" :column="$column" :customAttributes="$this->getFooterTdAttributes($column, $rows, $colIndex)">
{{ $column->getFooterContents($rows) }}
</x-livewire-tables::table.td.plain>
@endif
@continue($column->isReorderColumn() && !$this->getCurrentlyReorderingStatus() && $this->getHideReorderColumnUnlessReorderingStatus())
<x-livewire-tables::table.td.plain :displayMinimisedOnReorder="true" wire:key="{{ $tableName .'-footer-shown-'.$colIndex }}" :column="$column" :customAttributes="$this->getFooterTdAttributes($column, $rows, $colIndex)">
{{ $column->getFooterContents($rows) }}
</x-livewire-tables::table.td.plain>
@endforeach
</x-livewire-tables::table.tr.plain>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@foreach($this->getColumns() as $colIndex => $column)
@continue($column->isHidden())
@continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column))
@continue($column->isReorderColumn() && !$this->getCurrentlyReorderingStatus())
@continue($column->isReorderColumn() && !$this->getCurrentlyReorderingStatus() && $this->getHideReorderColumnUnlessReorderingStatus())

<x-livewire-tables::table.td.plain :column="$column" :displayMinimisedOnReorder="true" wire:key="{{ $tableName .'-secondary-header-show-'.$column->getSlug() }}" :customAttributes="$this->getSecondaryHeaderTdAttributes($column, $rows, $colIndex)">
{{ $column->getSecondaryHeaderContents($rows) }}
Expand Down
4 changes: 2 additions & 2 deletions resources/views/datatable.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@foreach($columns as $index => $column)
@continue($column->isHidden())
@continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column))
@continue($column->isReorderColumn() && !$this->getCurrentlyReorderingStatus())
@continue($column->isReorderColumn() && !$this->getCurrentlyReorderingStatus() && $this->getHideReorderColumnUnlessReorderingStatus())

<x-livewire-tables::table.th wire:key="{{ $tableName.'-table-head-'.$index }}" :column="$column" :index="$index" />
@endforeach
Expand All @@ -42,7 +42,7 @@
@foreach($columns as $colIndex => $column)
@continue($column->isHidden())
@continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column))
@continue($column->isReorderColumn() && !$this->getCurrentlyReorderingStatus())
@continue($column->isReorderColumn() && !$this->getCurrentlyReorderingStatus() && $this->getHideReorderColumnUnlessReorderingStatus())

<x-livewire-tables::table.td wire:key="{{ $tableName . '-' . $row->{$this->getPrimaryKey()} . '-datatable-td-' . $column->getSlug() }}" :column="$column" :colIndex="$colIndex">
{{ $column->renderContents($row) }}
Expand Down

0 comments on commit 31ae8fe

Please sign in to comment.