Menu on responsive display of datatables
I have a action menu in a datatable as in the demo, but i set the responsive to true. So when the actions menu is on responsive view on click dont show the menu.
Im working with ajax server side and i use
drawCallback : function(){ KTMenu.createInstances(); and i try
table.on("responsive-display", function(e, datatable, row, showHide, update) {
if (showHide) {
KTMenu.createInstances();
}
}); But not success. So i need a little help

Replies (3)
Hi
Can you try to delay the reâinitialization call—this allows the responsive row markup to finish rendering before KTMenu runs. You can try wrapping your call in a small timeout. For example:
table.on("responsive-display", function(e, datatable, row, showHide, update) {
if (showHide) {
setTimeout(() => {
KTMenu.createInstances();
}, 100); // try 100ms; adjust if needed
}
});