ThomasSiegmund / D3TableFilter

A table widget based on Max Guglielmi's "HTML Table Filter Generator" and D3.js
Other
65 stars 17 forks source link

Scrolling? #10

Closed DataStrategist closed 8 years ago

DataStrategist commented 8 years ago

It seems the original table allows for an object: fixed_headers which allows for scrolling, has this been passed to this package? For very wide tables, I need to be able to scroll the page, but the html page that is born does not have scroll-bars enabled.

ThomasSiegmund commented 8 years ago

This function of TableFilter never worked for me, not even the plain demo from the TableFilter web site:

http://tablefilter.free.fr/fixed-headers2.htm

So it also won't work in the D3TableFilter environment.

Sorry

Thomas

DataStrategist commented 8 years ago

True, even those fixed headers weren't fixed... but they allow for scollbars... image

How could I enable the same functionality in D3TableFilter?

ThomasSiegmund commented 8 years ago

Vertical scroll bars should show up whenever needed. Please provide an example where you miss them.

For horizontal scroll bars you may need to specify absolute column widths. In the context of a bootstrap layout, e.g. in a shiny app, there will be no scroll bars because the bootstrap grid system will define the available space. Within this space TableFilter will adjust the column widths accordingly automatically to make the table fit. To avoid this you could specify the column widths in absolute pixels, e.g

tableProps <- list(
        # fixed column width
        col_width = list("150px", "200px")
    );
DataStrategist commented 8 years ago

Hi Thomas. Actually, the opposite seems to be true... the table dynamically re-sizes horizontally to fit the content, so scrollbars are not required. The vertical scrollbar however does not show up:

image

DataStrategist commented 8 years ago

I also had another hypothesis... perhaps the vertical scrollbar doesn't show up if the original table is small enough to fit into one 'screen-ful'... So I made my table very long so that when the table loads it's already too long... and still the scrollbars do not spawn.

I'm using windows 10. In Chrome, the scroll-bar doesn't show up at all. In IE, the scroll-bar shows up, but is full in other words, it thinks there's no content to scroll... image

ThomasSiegmund commented 8 years ago

I guess a reproducible example and a screenshot might help ...

On Thu, Apr 7, 2016 at 2:04 PM, Amit notifications@github.com wrote:

I also had another hypothesis... perhaps the vertical scrollbar doesn't show up if the original table is small enough to fit into one 'screen-ful'... So I made my table very long so that when the table loads it's already too long... and still the scrollbars do not spawn.

I'm using windows 10. In Chrome, the scroll-bar doesn't show up at all. In IE, the scroll-bar shows up, but is full in other words, it thinks there's no content to scroll... [image: image] https://cloud.githubusercontent.com/assets/8094091/14350448/e2dbdcea-fcb8-11e5-86c9-27910b4fc4ba.png

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/ThomasSiegmund/D3TableFilter/issues/10#issuecomment-206838787

DataStrategist commented 8 years ago

Sorry, I should have started there. Here you go:

B <- data.frame(a=1:200,b=1:200,c=1:200,d=1:200)
  c <- d3tf(B,
     selectableRowsClass = "warning")

I expect that to have vertical scrollbars , correct?

ThomasSiegmund commented 8 years ago

Ah, I see. Usually I don't use the widget outside of Shiny apps. The vertical scrollbars will show up if you specify the height in the d3tf() call:

d3tf(B, height = "400px")

or

d3tf(B, height = "auto")

Within Shiny the heigth is specified in d3tfOutput().

DataStrategist commented 8 years ago

Correct. Perfect, thank you.