Sticky headers stops tracking and changing visibility once a part of the page is updated with AJAX and Drupal.attachBehaviours is called.
This happend cause once Drupal.attachBehaviours is called then all previous data in "headers" variable (@see Drupal.behaviors.tableHeader) is erased. The data in "headers" variable presents array of already created sticky-header elements.

A proposed solution is very simple - prepopulate "headers" variable with already created sticky-header elements:

--- a/drupal/misc/tableheader.js
+++ b/drupal/misc/tableheader.js
@@ -15,6 +15,8 @@ Drupal.behaviors.tableHeader = function (context) {
   // Keep track of all cloned table headers.
   var headers = [];

+  $(".sticky-header").each(function(i, el){headers.push(el);});
+
   $('table.sticky-enabled thead:not(.tableHeader-processed)', context).each(function () {
     // Clone thead so it inherits original jQuery properties.
     var headerClone = $(this).clone(true).insertBefore(this.parentNode).wrap('<table class="sticky-header"></table>').parent().css({

Comments

pwolanin’s picture

Version: 6.22 » 6.x-dev
Issue summary: View changes
Status: Patch (to be ported) » Active

Does this bug still happen in Drupal 7.x or 8.x? If so, it needs to be fixed there first.

Why are you marking this as "to be ported"?

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.