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