F
Filament9mo ago
DMB

ToggleColumns bug?

public static function table(Table $table): Table
{
return $table
->groups([
Tables\Grouping\Group::make('boxTemplate.id')
->label('Šablonas'),
Tables\Grouping\Group::make('confirmed')
->label('Aktyvi'),
])
//->defaultGroup('boxTemplate.id')
->columns([
Tables\Columns\Layout\Split::make([
Tables\Columns\TextColumn::make('boxTemplate.name')
->size(Tables\Columns\TextColumn\TextColumnSize::ExtraSmall)
->description(function ($record) { return 'ID: '.$record->boxTemplate->id ?? ''; })
->label('Šablonas'),
Tables\Columns\TextColumn::make('company.name')
->label('Įmonė'),
Tables\Columns\Layout\Stack::make([
Tables\Columns\TextColumn::make('invoice_number')
->label('Sąskaitos numeris')
->searchable(),
Tables\Columns\TextColumn::make('date')
->size(Tables\Columns\TextColumn\TextColumnSize::ExtraSmall)
->label('Sąskaitos data')
->date('Y-m-d')
->searchable(),
]),
Tables\Columns\Layout\Stack::make([
Tables\Columns\TextColumn::make('boxTemplateList.boxTemplateCategory.name')
->label('Pakuotė')
->size(Tables\Columns\TextColumn\TextColumnSize::ExtraSmall),
Tables\Columns\TextColumn::make('boxTemplateList.gpais.name')
->label('Gpais kodas')
->size(Tables\Columns\TextColumn\TextColumnSize::ExtraSmall),
]),
->formatStateUsing(fn (string $state, $record) => number_format($record->amount / $state, 0) ),
Tables\Columns\ToggleColumn::make('confirmed')
->label('Aktyvi'),
])
])
public static function table(Table $table): Table
{
return $table
->groups([
Tables\Grouping\Group::make('boxTemplate.id')
->label('Šablonas'),
Tables\Grouping\Group::make('confirmed')
->label('Aktyvi'),
])
//->defaultGroup('boxTemplate.id')
->columns([
Tables\Columns\Layout\Split::make([
Tables\Columns\TextColumn::make('boxTemplate.name')
->size(Tables\Columns\TextColumn\TextColumnSize::ExtraSmall)
->description(function ($record) { return 'ID: '.$record->boxTemplate->id ?? ''; })
->label('Šablonas'),
Tables\Columns\TextColumn::make('company.name')
->label('Įmonė'),
Tables\Columns\Layout\Stack::make([
Tables\Columns\TextColumn::make('invoice_number')
->label('Sąskaitos numeris')
->searchable(),
Tables\Columns\TextColumn::make('date')
->size(Tables\Columns\TextColumn\TextColumnSize::ExtraSmall)
->label('Sąskaitos data')
->date('Y-m-d')
->searchable(),
]),
Tables\Columns\Layout\Stack::make([
Tables\Columns\TextColumn::make('boxTemplateList.boxTemplateCategory.name')
->label('Pakuotė')
->size(Tables\Columns\TextColumn\TextColumnSize::ExtraSmall),
Tables\Columns\TextColumn::make('boxTemplateList.gpais.name')
->label('Gpais kodas')
->size(Tables\Columns\TextColumn\TextColumnSize::ExtraSmall),
]),
->formatStateUsing(fn (string $state, $record) => number_format($record->amount / $state, 0) ),
Tables\Columns\ToggleColumn::make('confirmed')
->label('Aktyvi'),
])
])
2 Replies
DMB
DMBOP9mo ago
ToglleColumn press, toggle value write, and open edit records (Stack, Split in table). Bugs? normal table works correct toggleColumns
tg
tg8mo ago
I have the same issue, currently using v3.2.63. Just to make clear what the issue is: 1. Define a Table with a Split layout component for a resource which has an Edit page 2. add a ToggleColumn 3. Navigate to that table, click the toggle column: the toggled value is changed, but it also opens the edit page for that resource. This behavior does not occur when: a) The resource does not have an edit page: The edit modal does not open on toggle column clicks b) The table definition explicitly disables the default recordUrl to the edit page ping @Dan Harrin @Dennis Koch I'll check if I can find the cause, likely a click handler conflict
Want results from more Discord servers?
Add your server