Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

Dropdown button not working on Datatable using yajra datatables laravel 8

Good day! I would like to ask question how to enable dropdown button on datatables? I added droptop to action column but only the button is showing, when clicked, nothing happens, no option being shown.

I am using yajra datatables plugin with ajax on getting data from the database.

$colleges = DB::table("pl_college");

return datatables($colleges->get())
->addColumn("c_code", function($row) {
return $row->c_code;
->addColumn("c_name", function($row) {
return $row->c_name;
->addColumn("c_dean", function($row) {
return $row->c_dean;
->addColumn("action", function($row) {
$action = " <div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown button
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>

return $action;


Text formatting options

Replies (1)


Could you please try to add this to the datatable option?

"drawCallback" => "function() { KTMenu.createInstances(); }",


Text formatting options
Text formatting options