pritykinlab / guidescanpy

1 stars 0 forks source link

Paginated ajax call in job_query #42

Closed 1rzhu closed 1 year ago

1rzhu commented 1 year ago

Changed the DataTables' data source in 'job_query.html' to paginated ajax data. Parsed pagination args to API.

1rzhu commented 1 year ago

I kept the 'result' function the same as the PR #34, and added a new function 'result_dt' to generate the DataTable source data to avoid messing with the original function. I also added server-side sorting functionality to the DataTables, and set a default order of ['coordinate', 'asc'].

vineetbansal commented 1 year ago

Yes - a separate result_dt function is a good idea since so many things in that function are specialized. However, I made some tiny tweaks in the get_result function so as to not pass in the dt parameter (in general, it's best to have generally useful functions not be aware of who's calling them, but let the caller decide if they want to slightly reformat the results or ignore certain return values of the function - for example, the non-DT caller can simply ignore total_hits in this case).

I've tested this out locally but you may want to do so as well before approving it.

1rzhu commented 1 year ago

Thank you, Vineet! The functions look more organized this way. I also tested it locally, it works very well. We can approve it now.