filamentgroup / tablesaw

A group of plugins for responsive tables.
MIT License
5.48k stars 434 forks source link

Columns priority - right to left (Again) #275

Closed CCvinc closed 5 years ago

CCvinc commented 7 years ago

I'm going to explain what i'm looking for with examples. I hope you will better understand.

With a small window, here is the current load of the Swipe table (DEMO)

default

Columns A and B are displayed. C/D/E are hidden.


With a small window, here is what i'm looking for (directly when the table is loaded)

capturzdzde4

Columns A and E are displayed. B/C/D are hidden.

In fact i just want to change the "hiding order" when the window is resized. B must be the 1st column hiden. Then C must be the 2nd column hiden. etc... And if the window is really too small, E is also hidden... and only the column A is displayed.

I hope my request is now better understund. Sorry if i'm a little bit boring...

Best regards, Vincent.

Previous issue : #273

DanielRuf commented 6 years ago

It seems we have to loop over them with a reversed for-loop:

$headerCells.each(function(index) {
                var $t = $(this),
                    isPersist = $t.is('[data-tablesaw-priority="persist"]');

                persist.push(isPersist);
                sum += headerWidths[index];
                sums.push(sum);

                // is persistent or is hidden
                if (isPersist || sum > containerWidth) {
                    visibleNonPersistantCount--;
                }
      });
DanielRuf commented 6 years ago

$($headerCells).get().reverse().each would be a first step.

zachleat commented 5 years ago

This repository is now using lodash style issue management for enhancements. This means enhancement issues will now be closed instead of leaving them open.

The enhancement backlog can be found here: https://github.com/filamentgroup/tablesaw/issues?utf8=%E2%9C%93&q=label%3Aneeds-votes+sort%3Areactions-%2B1-desc+

Don’t forget to upvote the top comment with 👍!