getScript conditional loading

getScript conditional loading

nskwortsownskwortsow Posts: 120Questions: 0Answers: 0
edited November 2012 in Editor
Hi,

I have several Datatables instances on one page (different tabs), and I only want to load the active tab to reduce server load.

When using getScript to load my scripts conditionally, the data is not being populated (getScript is being called though).

Do the tables need to be reinitialized?

N

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    As in jQuery's getScript? How is it being used? If you want the data for the active tab only, you'd need to use the tab's `show` event (assuming the tab control that you are using has one) and initialise the DataTable / load the data at that point.

    Allan
  • nskwortsownskwortsow Posts: 120Questions: 0Answers: 0
    It's working now. Problem was with variable scoping in my jQuery / JS.
This discussion has been closed.