ckangwei83
tooltip
for whoever needed this, below method works for me. it is not working when doing x-tooltip.html or x-tooltip.raw alone. But somehow defined an empty x-tooltip.html will make the raw works with html.
TextColumn::make('name')
->html()
->extraAttributes(fn (Model $record): Array => [ 'x-tooltip.html' => new HtmlString(), 'x-tooltip.raw' => new HtmlString(implode('<br>- ', ($record->whatever ?? ['-']))), ]),
->extraAttributes(fn (Model $record): Array => [ 'x-tooltip.html' => new HtmlString(), 'x-tooltip.raw' => new HtmlString(implode('<br>- ', ($record->whatever ?? ['-']))), ]),
12 replies
Is possible to use Tooltip with html content?
forwhoever needed this, below method works for me. it is not working when doing x-tooltip.html or x-tooltip.raw alone. But somehow defined an empty x-tooltip.html will make the raw works with html. hope this helps
TextColumn::make('name')
->html()
->extraAttributes(fn (Model $record): Array => [ 'x-tooltip.html' => new HtmlString(), 'x-tooltip.raw' => new HtmlString(implode('<br>- ', ($record->whatever ?? ['-']))), ]),
->extraAttributes(fn (Model $record): Array => [ 'x-tooltip.html' => new HtmlString(), 'x-tooltip.raw' => new HtmlString(implode('<br>- ', ($record->whatever ?? ['-']))), ]),
5 replies
HTML in tooltip for table columns
forwhoever needed this, below method works for me. it is not working when doing x-tooltip.html or x-tooltip.raw alone. But somehow defined an empty x-tooltip.html will make the raw works with html.
TextColumn::make('name')
->html()
->extraAttributes(fn (Model $record): Array => [ 'x-tooltip.html' => new HtmlString(), 'x-tooltip.raw' => new HtmlString(implode('<br>- ', ($record->whatever ?? ['-']))), ]),
->extraAttributes(fn (Model $record): Array => [ 'x-tooltip.html' => new HtmlString(), 'x-tooltip.raw' => new HtmlString(implode('<br>- ', ($record->whatever ?? ['-']))), ]),
4 replies