Problem/Motivation

I need to make the header sticky with a fixed header. Please suggest how to do it.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

keshavv created an issue. See original summary.

lazzyvn’s picture

there is another issue, but they confirm that it works
https://www.drupal.org/project/bootstrap_table/issues/3378593

keshavv’s picture

Status: Active » Closed (won't fix)

The solution is to add the hook to your custom theme and add the offset from the top accordingly.

/**
 * Implements hook_preprocess_views_view_bootstraptable().
 */
function template_preprocess_views_view_bootstraptable(&$variables) {
  $view = $variables['view'];
  $options = $view->style_plugin->options;
  if ($options["extension"]['sticky_header'] == 1) {
    if (\Drupal::currentUser()->hasPermission('access toolbar')) {
      // Set the Header offset from the top.
      $variables["attributes"]['data-sticky-header-offset-y'] = 80;
    }
  }
}