Certain SmartFields do not render any data on the list view, it’s just an empty column cell. When you click into the record, the data is there. Then clicking back to the list, only then does the data appears on that one row. It’s almost as if it’s lazy loading them on the list view and doesn’t actually fetch the data until you go to the individual record?
SmartField decleration on model:
public function artistTelephone(): SmartField
{
return $this->smartField(['type' => 'String'])->get(fn() =>
$this->artist != null ? $this->artist->telephone : 'No artist attached'
);
}
Expected behavior
The SmartField columns display in their entirity on the listing, without having to click into the record and back again.
Thanks! As a side note this also seems to happen occasionally with smart fields on details views. The dynamic smart fields appear for a second, then dissapear again.
Has your problem with the artistTelephone smartField been corrected with version 1.2.5?
Regarding your problem in the video, is the uuid field dynamic or is it a column in your table? If the field is dynamic, could you share your function?
I think I have identified the problem, the uuid field isn’t displayed in the list view, so it isn’t retrieved from the table and its value is null when the smart field is calculated.
Unfortunately, the only way to solve the problem is to refresh the model before returning the calculated value. You could put $this->refresh() at the beginning of the get() closure.