Skip to content

Conversation

om3rcitak
Copy link
Contributor

Improve adding custom action to buttons.

For example I want add a button with custom action but this package not supported that. After this pull request, everybody can button with custom action using via like following code:

File: app/Datatables/UsersDataTable.php

...
public function html()
    {
        return $this->builder()
            ->setTableId('usersdatatable-table')
            ->columns($this->getColumns())
            ->minifiedAjax()
            ->dom('Bfrtip')
            ->orderBy(0)
            ->buttons(
                (new Button)->text('Button Test')->action('alert("clicked!")')
            );
    }
...

Btw, I supported before this PR codes. So this PR not broke older codes.

@yajra yajra changed the title improve adding custom action to buttons Improve adding custom action to buttons. Nov 11, 2019
@yajra yajra merged commit 10c6798 into yajra:4.0 Nov 11, 2019
@yajra
Copy link
Owner

yajra commented Nov 11, 2019

Released on v4.20.0 🚀

@matteocostantini
Copy link
Contributor

Hi, i have install 4.20 in 7.0.33 php environment (it's need...) but
(1/1) FatalThrowableErrorCall to undefined function Yajra\DataTables\Html\substring()

Can you help me?

@om3rcitak
Copy link
Contributor Author

om3rcitak commented Nov 11, 2019

@matteocostantini I send PR for your problem. Details: #116

@yajra This PR should be published immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants