Table Widget hidden() not working

I have a Table Widget on a view page. On a TextColumn i have the following code:
->icon(fn ($record) => json_decode($record->details)->ConsumerDetails->DeliveryMethod === 'AFH' ? 'heroicon-s-building-storefront' : 'heroicon-s-truck')
->icon(fn ($record) => json_decode($record->details)->ConsumerDetails->DeliveryMethod === 'AFH' ? 'heroicon-s-building-storefront' : 'heroicon-s-truck')
->hidden(fn ($record) => json_decode($record->details)->ConsumerDetails->DeliveryMethod === 'AFH')
->hidden(fn ($record) => json_decode($record->details)->ConsumerDetails->DeliveryMethod === 'AFH')
For some reason the ->icon() is working fine and for ->hidden() i get the error: Attempt to read property "details" on null
2 Replies
LeandroFerreira
LeandroFerreira7mo ago
You can't show/hide columns by row. Use ->disabled(), formatStateUsing ..
Thijmen
Thijmen7mo ago
It works fine on all the other tables if you have 1 row