mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
docs: adding functionality to hide the grouping direction
This commit is contained in:
@@ -323,6 +323,21 @@ public function table(Table $table): Table
|
||||
}
|
||||
```
|
||||
|
||||
## Hiding the grouping direction settings
|
||||
|
||||
You can hide the grouping direction drop-down select interface using the `groupingDirectionHidden()` method:
|
||||
|
||||
```php
|
||||
use Filament\Tables\Table;
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->defaultGroup('status');
|
||||
->groupingDirectionHidden();
|
||||
}
|
||||
```
|
||||
|
||||
## Hiding the grouping settings
|
||||
|
||||
You can hide the grouping settings interface using the `groupingSettingsHidden()` method:
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Filament\Tests\Tables\Fixtures\PostsTable;
|
||||
use Filament\Tests\Tables\TestCase;
|
||||
use function Filament\Tests\livewire;
|
||||
|
||||
uses(TestCase::class);
|
||||
|
||||
it('can hide group direction when `groupingDirectionHidden()` method called', function (): void {
|
||||
livewire(PostsTable::class)->assertHasNoErrors()
|
||||
->assertDontSee('<x-filament::input.select x-model="direction">')
|
||||
->assertDontSee(__('filament-tables::table.grouping.fields.direction.options.asc'))
|
||||
->assertDontSee(__('filament-tables::table.grouping.fields.direction.options.desc'));
|
||||
});
|
||||
Reference in New Issue
Block a user