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?
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();
}