Paged table and additional getJSON calls on visible rows only

Paged table and additional getJSON calls on visible rows only

mikelmikel Posts: 2Questions: 1Answers: 0

We have data that is stored in Access databases (not my choice but we need to deal with it) and I need to display information which is pulled from a number of different tables across different databases. We've been using a homebrew system for a while which has limited functionality and DataTables seems to be the perfect solution but I can't quite get the functionality I'm looking for.

The user enters a query in a form field and the results are populated in numerous DataTables objects and made visible to the user. The results for a query can be as little as 1 or in the 100's. After the initial query returns and DataTables has been filled and displayed to the user, some DataTables require additional getJSON calls to query another database which updates a couple cells for each row. The cells are initially filled with loader icons until the getJSON returns and the cells are populated with the result.

DataTables is initialized to "page" the results and allows the user to filter the results as well. I used the createdRow callback but it doesn't appear to be what I want as it will execute for all rows, not just those displayed. If the initial results are in the 100's, I don't want to be making 100's of getJSON calls, I only want calls for the data currently displayed.

So how do I only update the cells that are visible for paged results? Are there specific callbacks to be used, or how do I get a list of visible rows regardless if a page change occurred or the results have been filtered?

View after DataTables has loaded the initial results and performing addition getJSON calls to fill the "Warranty" column for each row

View after DataTables has finished getJSON calls for each row

Answers

  • mikelmikel Posts: 2Questions: 1Answers: 0

    I thought more about this issue and decided that even though we're using Access databases, it is more efficient to do queries on the backend and join all the data rather than through multiple getJSON calls from the client side.

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    Are you saying you no longer have a question?

This discussion has been closed.