Closed macgadger closed 3 years ago
Hi @macgadger,
this is already possible by using the data
method. For example on a button
Button::make('my-column')->data(["href" => "id"]) // <button data-href="1">Edit</button>
The docs are incomplete for data attributes. I will edit the issue for incomplete docs en examples.
Below the list of modifications
Button
fieldHi @macgadger,
this is already possible by using the
data
method. For example on a buttonButton::make('my-column')->data(["href" => "id"]) // <button data-href="1">Edit</button>
The docs are incomplete for data attributes. I will edit the issue for incomplete docs en examples.
Great! Work like charm. :)
while working on data attributes , i found that i can not pass custom strings or route to attributes like:
Button::make('action')->class('btn btn-outline-info btn-sm modal-link')->icon("fa fa-plus")->data([ 'href' => 'id', 'url' => route('users.edit','id'), 'placement' => 'top' ]),
with code above i am getting error in console:
data-placement="undefined"
in html code
VM7590:8 Uncaught SyntaxError: Missing } in template expression
in console
Thanks in advance.
Hi @macgadger,
thats correct, the data method doens't support custom data objects other then column values. Can you create a new issue with this enhancement ?
Hi,
Feature Request, Please add function to fields so that user can add custom data attributes to buttons etc like:
<button data-href="route/id/edit" data-title="Edit this">Edit</button>
i tried to do it myself but unable to get model id from route to attribute value. I also find that there is no function to enable/disable and modify autoreload datatables.
Bug: When you dont add route or anything to button, when clicked button redirecting to undefined route. which i fixed.
Thanks.