And then once the page loads the user can select to show more columns?

I have a view with 20+ columns of data and would prefer it if just a handful of columns would show on load and then the user given the chance to show more columns if they wish.

At the moment, all columns in the view table load and then you can choose to hide those you dont want to see.

Comments

effortDee created an issue. See original summary.

mark_fullmer’s picture

Thanks for asking about this. Something like that might be possible with the "Column Toggle" style provided by Tablesaw (see https://filamentgroup.github.io/tablesaw/demo/toggle.html).

Since you are referencing this affecting a Drupal View, however, and since different Drupal Views would have differing numbers of columns, there would probably need to be some way to add the data-tablesaw-priority attribute arbitrarily to Views column headers. A summary of this can be found at https://github.com/filamentgroup/tablesaw#column-toggle-mode:

Table headers must have a data-tablesaw-priority attribute to be eligible to toggle. data-tablesaw-priority is a numeric value from 1 to 6, which determine default breakpoints at which a column will show.

Drupal core doesn't expose a UI to add arbitrary data attributes to table rows as far as I know, and a quick search of contributed modules doesn't turn anything up. So I think in order to achieve this on a per-View basis, you would need to use Views preprocessing as described in https://chrisburge.net/blog/add-attributes-table-markup-views

I'll leave this issue open for a bit to see if you concur with this analysis, and then plan to mark is as "Closed: Works as Designed."

mark_fullmer’s picture

Status: Active » Closed (works as designed)

Marking as "Closed (works as designed)" per comment above.