F
Filament16mo 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
lpoems16mo ago
try class CustomColumn extends TextColumn
wyChoong
wyChoong16mo ago
what is not working with your code, because it seems logical
Want results from more Discord servers?
Add your server