F
Filament2y ago
dyo

Limit text in viewColumn

How can I use or implement attribute like in textColumn in custom column?
->limit(25)
->tooltip(function (TextColumn $column): ?string {
$state = $column->getState();

if (strlen($state) <= $column->getLimit()) {
return null;
}

// Only render the tooltip if the column contents exceeds the length limit.
return $state;
})
->limit(25)
->tooltip(function (TextColumn $column): ?string {
$state = $column->getState();

if (strlen($state) <= $column->getLimit()) {
return null;
}

// Only render the tooltip if the column contents exceeds the length limit.
return $state;
})
2 Replies
lpoems
lpoems2y ago
try class CustomColumn extends TextColumn
wyChoong
wyChoong2y ago
what is not working with your code, because it seems logical

Did you find this page helpful?