I have a question if someone else was in this kind of situation maybe they have a solution, for Laravel Orchid im trying to make a Copy to Clipboard Button for the Column Name with the clipboard.js. I didn't get how to use it with Laravel Orchid for other Projects it was okay.
my layout looks like this :
...
protected function columns(): array
{
return [
TD::make('name', 'Name')
->render(function ($item) {
return
Group::make([
Link::make($item->name)->route('platform.item.show', $item),
Button::make('myBtn')->id('#myBtn')
]);
})->sort(),
....
but with the click on the button im getting only an error:
TypeError
Argument 1 passed to Orchid\Screen\Screen::callMethod() must be of the type string, null given, called in /Volumes/T5/www/inventory-manager-laravel/vendor/orchid/platform/src/Screen/Screen.php on line 179
what i want is i have in my script.js a function which listening to this id and using then the clipboard js, is there a better way for achieving my goal what am i doing wrong ?
Thanks in advance
Jaba, as far as I understand, the button must have a method
Button::make('myBtn')->id('#myBtn')->method('foo')
. DocSo, you could use
Link::make('myBtn')->id('#myBtn')
and style it with->class('foo-class')
. Total:Link::make('myBtn')->class('btn btn-primary')->id('#myBtn')
;