How to add menu buttons in a Datatable processed on a server side

How to add menu buttons in a Datatable processed on a server side

rickierickie Posts: 3Questions: 3Answers: 0

Below is my code

                {
                    title: 'Action',
                    data: 'public_id',
                    width: 4,
                    searchable: false,
                    sortable: false,
                    render(data, type, row, meta) {
                        return `
                            <div class="dropdown">
                                <button id="closeCard2" style="padding: 2px 8px" type="button" aria-expanded="false" class="btn btn-info btn-sm" data-toggle="dropdown" aria-haspopup="true">
                                    <i class="fa fa-ellipsis-v"></i>
                                </button>
                                <div aria-labelledby="closeCard2" class="dropdown-menu dropdown-menu-right has-success">
                                    <a href="#" class="dropdown-item text-info"><i class="fa fa-edit"></i>&nbsp;&nbsp;Edit</a>
                                    <a href="#" class="dropdown-item text-danger"><i class="fa fa-edit"></i>&nbsp;&nbsp;Delete</a>
                                </div>
                            </div>
                        `;
                    }
                }

I want to be able to make the actions button be a dropdown

Thanks in advance

Answers

Sign In or Register to comment.