Great question — answering as the UphillTech team:
To fulfill your requirement you should follow the given steps. 1. $(document).ready(function () );i.e. Use jquery DOM when the document is ready. 2. $('.my_button').click(function () );i.e. When you click your button modal should be loaded. 3. $('#mydatatable').DataTable(); i.e. Load the datatable at last inside the body of $(document).ready(function ()); $(document).ready(function () { //When the button is clicked $('.my_button').click(function () { //Your code for modal });<br> $('#mydatatable').DataTable(); });
Full answer by Ramesh KC: https://stackoverflow.stackexchange.com/a/50544786 (CC BY-SA 3.0).
Need it done for your business? UphillTech.