sejtam
sejtam
FFilament
Created by sejtam on 8/17/2023 in #❓┊help
Refresh table after changing values with updateStateUsing
Hello, I using CheckBoxColumn to select default language. I changing values of rows in updateStateUsing and I need render this values after change. (Only after the page is refreshed will it be rendered). Is there a way to do this? Thank you for your answers 🙂
CheckboxColumn::make(config('better-lang.tables.columns.lang_code.default'))
->label(__('filament-better-lang::resources.lang_code.columns.default'))
->updateStateUsing(function ($record, $state) {
if($state) {
static::getModel()::query()
->update(['default' => false]);
$record->update(['default' => true]);
}

// TODO: Refresh table
return $state;
})
CheckboxColumn::make(config('better-lang.tables.columns.lang_code.default'))
->label(__('filament-better-lang::resources.lang_code.columns.default'))
->updateStateUsing(function ($record, $state) {
if($state) {
static::getModel()::query()
->update(['default' => false]);
$record->update(['default' => true]);
}

// TODO: Refresh table
return $state;
})
4 replies