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 Koch10mo ago
This is on select, right? There is another ->allowHtml() method that you need.
_bigroom
_bigroomOP10mo ago
Thank you. But I don't use select. I hide the grouping settings as follows. ->groupingSettingsHidden()
Dennis Koch
Dennis Koch10mo ago
Sorry, but I have no idea where your code example is from. Maybe share some context
_bigroom
_bigroomOP10mo 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 Koch10mo ago
Maybe the method doesn't accept HtmlString? Can you check the signatures of the method/property 🤔
_bigroom
_bigroomOP10mo ago
Yes,method doesn't accept HtmlString.I am trying to find another way.
Dennis Koch
Dennis Koch10mo ago
You can try a PR to change that
Want results from more Discord servers?
Add your server