Patch for JSON/AJAX Data Source

Created on 22 July 2013, almost 11 years ago
Updated 17 January 2024, 5 months ago

Patch attached that supports 'sAjaxSource'. This means that a page will be rendered as quickly as possible and fetch the results using AJAX/JSON - I've tested it with caching enabled - which requires a slight workaround (i.e. delete the non-ajax cache cids) - the trick I've used is to limit the original results to a single record (which should enable token replacements from the first line) and then fetch the rest on an Ajax call.

Roughly what is involved in this patch:

  1. Adds a setting to the datatables style plugin to enabled "ajax_defer"; (possibly needs renaming)
  2. Provides a views query plugin that reduces the original view results to 1 record;
  3. Implements hook_views_post_execute(), which deletes the original single view result so that the ajax results will cache too;

Hopefully this is something that could be interesting incorporating into the module?

πŸ“Œ Task
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom RobinMofo

Live updates comments and jobs are added and updated live.
  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺGermany diqidoq Berlin | Hamburg | New York | London | Paris

    Due to inactivity for years and because of upcoming EOL of Drupal 7 I set it to Closed to cleanup the issue queue. Thanks for taking the time to report and all the hard work here from so many awesome users here and maintainers on this! Read more about EOL of D7 here: https://www.drupal.org/about/drupal-7/d7eol/partners β†’

    If this feature is still missing/required/wanted or somebody has some time and can reroll the patch against latest dev branch (2.x) feel free to reopen it.

Production build 0.69.0 2024