F
Filament4mo ago
u1

How to use html in getTitleFromRecordUsing

For example, by ->getTitleFromRecordUsing(fn ( $record): HtmlString => new HtmlString('<img src="'.$record->product->image.'" width="80" height="45">')) Or, if there is some other way to do this, I would appreciate your suggestion.
7 Replies
Dennis Koch
Dennis Koch4mo ago
This is on select, right? There is another ->allowHtml() method that you need.
u1
u14mo ago
Thank you. But I don't use select. I hide the grouping settings as follows. ->groupingSettingsHidden()
Dennis Koch
Dennis Koch4mo ago
Sorry, but I have no idea where your code example is from. Maybe share some context
u1
u14mo ago
Thanks for the suggestion. I would like to achieve the following ->defaultGroup('product.product_code') ->groupingSettingsHidden() ->groups([ Group::make('product.product_code') ->getTitleFromRecordUsing(function ( $record){ return new HtmlString('<button>'.$recrod->product_code.'</button>'); }) ])
No description
Dennis Koch
Dennis Koch4mo ago
Maybe the method doesn't accept HtmlString? Can you check the signatures of the method/property 🤔
u1
u14mo ago
Yes,method doesn't accept HtmlString.I am trying to find another way.
Dennis Koch
Dennis Koch4mo ago
You can try a PR to change that