Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

Dropdown menu in datatable not working


I currently use the dropdown menu "actions" used to show a dropdown menu (https://preview.keenthemes.com/keen/demo1/apps/user-management/users/list.html).

When using C# to show data in the datatable, everything works fine. But, I currently need to use javascript to get data and this is why I use jQuery. I inserted the HTML into the columns attribute. The "actions" button appear, with all the HTML, but the trigger 'click' is not working.

Per my understanding, there must be an action that is called before I return the data.

Can anyone knows more about this problem?


Text formatting options
Submit

Replies (2)


return {
init: function() {
table = document.querySelector('#table_list');

if (!table) {
return;
}
initDatatable();

datatable.on('draw', function() {
KTMenu.createInstances();
});
}
};



Hi Martin Maheux,

I guess that you are rendering content of the page asynchronously. Since our component is initialized on first-page load but content of your datatable renderers asynchronously you need to recall KTMenu.createInstances();, after content was rendered.

You can call this function inside datatable 'draw' event.


datatable.on("draw", function () {
KTMenu.createInstances();
}


Regards,
Lauris Stepanovs,
Keenthemes Support Team


Text formatting options
Submit
Text formatting options
Submit