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
rickie
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> Edit</a>
<a href="#" class="dropdown-item text-danger"><i class="fa fa-edit"></i> Delete</a>
</div>
</div>
`;
}
}
I want to be able to make the actions button be a dropdown
Thanks in advance
Answers
Doss what you posted not work?
What happens?
If you need help debugging an issue please post a link to your page or a test case replicating the issue. It doesn't need to be server side processing however you can start with a server side processing template here for a test case.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin