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

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 happy


Text formatting options
Submit

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



Thank you very much. I don't know why I didn't think of this before. happy



Glad it worked.

Thanks


Text formatting options
Submit
Text formatting options
Submit