Introducing ReUI:Open-source UI components and apps built with React, Next.js and Tailwind CSS
Browse ReUI

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