Do not load table if the table is on another tab
Do not load table if the table is on another tab
alterego
Posts: 8Questions: 3Answers: 0
Hello,
Is there a way to only load the table from ajax if it is visbile?
For example, if the table is on a hidden bootstrap tab, it shouldn't load unnecessarily until the tab becomes active.
Thanks
This discussion has been closed.
Answers
Use the Bootstrap shown.bs.tab event and initialize the table when the tab is shown. You will want to use
$.fn.dataTable.isDataTable()
to make sure the Datatable is initialized only once.Kevin