Two Tables: Delayed loading of Data in Table 2 until data in Table 1 is loaded.

Two Tables: Delayed loading of Data in Table 2 until data in Table 1 is loaded.

lolwattanamelolwattaname Posts: 3Questions: 2Answers: 0

Hi all,

I have a page which has two datatables on it. The first datatable ((TableA)) loads on the left and has a number of records in it. The second datatable ((TableB)), on the right, loads detailed records when a record in TableA is clicked. When my page first appears I want TableA to load first, then when it is complete, TableB would load using the ID of the first record in TableA. I already have a function that takes the ID from TableA and loads data into TableB... I just need this function to execute in a specific order. Right now both tables launch into their loading process at the same time so the second table just loads data without knowing what the ID it should load.

I'm looking for a solution that would function similar to a jQuery Ajax promise but I haven't figured out how to use promises with jQuery Datatables.

Any advice would be greatly appreciated.

Sign In or Register to comment.