Skip to content

Ajax batch action not working? #3190

@Seb33300

Description

@Seb33300

In the laravel-datatables-vite repository, I found an interesting ajax batch feature that is supposed to be used by creating a button like this:

 Button::make('ajaxBatch')
     ->text('Restore')
     ->url(route('batch-restore-action-url'))
     ->confirmation('Generic confirmation message.') // Optional if you want confirmation before proceeding.
     ->onCancel('function(response) { alert("confirmation cancelled") }')
     ->onSuccess('function(response) { alert("success") }')
     ->onError('function(err) { alert("error") }')

See: https://github.com/yajra/laravel-datatables-vite/blob/51a126ec6020b7f3b97715e3e08af07c5be4f781/js/buttons/ajaxBatch.js#L6-L12

Unfortunately, if I try to use it in my Datatable class, this mails with the following error:

Method Yajra\DataTables\Html\Button::url does not exist.

I cannot find any reference of any of those methods in Laravel Datatables.

Did I miss something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions