question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

👎Horizontal Scrollbar

See original GitHub issue

I’m submitting a … (check one with “x”)

[X ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here

Current behavior I don’t understand why when I resize my table add big scrollbar horizontal. Here you can see gif… I tried to recalculate() table whe resizing this event is fired but nothing change to my table:

@HostListener('window:resize')
  onResize() {
    this.table.recalculate()
  }

Expected behavior I need my DOCUMENT column to have whole space in the middle and when resize stop at [minWidht] PS:status column need to be as in GIF at the end like my GIF, this is OK

Reproduction of the problem

GIF

strange error

CODE


<ngx-datatable
      #myTable
      class='material expandable'
      [columnMode]="'force'"
      [rowHeight]="50"
      [scrollbarV]="50"
      [rows]='rows'
      (page)="onPage($event)">
      <!-- Row Detail Template -->
      <ngx-datatable-row-detail ....>

      <!-- Column Templates -->
      <ngx-datatable-column
                            [width]="70"
                            [resizeable]="false"
                            [sortable]="false"
                            [draggable]="false"
                            [canAutoResize]="false">...</ngx-datatable-column>

      <ngx-datatable-column name="Document (QrCode)"
                            [resizeable]="false"
                            [sortable]="false"
                            [draggable]="false"
                            [minWidth]="300" >...</ngx-datatable-column>
      <ngx-datatable-column name="Status"
                            [width]="90"
                            [resizeable]="false"
                            [sortable]="false"
                            [draggable]="false"
                            [canAutoResize]="false">...</ngx-datatable-column>
    </ngx-datatable>

What is the motivation / use case for changing the behavior? only when resize because when I refresh page my resize are correct ! not when onResize

  • Table version: “^5.0.0”

  • Angular version: 2.0.x 2.4.4

  • Browser: chrome (last) and firefoy (last)

  • Language: TypeScript

PS: Potential solution:

I juste checked width of <datatable-scroller> never changed when resize, so when I arrive on my page the width is correct but when resize window: width of this component is never updated. So I tried to ovveride this css to width:100% and it works, any idea?:

datatable-scroller{
  width:100% !important;
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:22
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
julmotcommented, Mar 18, 2021

not stale.

4reactions
saithiscommented, Aug 17, 2017

@amcdnl I noticed, that it mostly happens for us when the app is initially loaded and I think it has something to do with the browser scrollbar. Something like this:

  1. App gets loaded with a empty datatable (because the data is loaded from the server). The page is shorter than the browser height.
  2. Data arrives and when setting the collumns, columnGroupWidths.total is calculated.
  3. Angular renders the rows, which makes the page longer than the browser height -> browser shows a scrollbar, which decreases the page/datatable width -> columnGroupWidths.total is now wrong and datatable-scroller shows a scrollbar.

It also happens with a left sidebar, which has a css transition on the width to scroll in from the side. I tried to fix that by calling this.table.recalculate() after the transition ends, but as described in my previous comment, this doesn’t recalculate columnGroupWidths.total.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Horizontal scrollbar is not easily accessible or visible on Boards
The horizontal scroll is just below the visible area (note the small gap in the v-scroll) requiring scrolling to reveal. Essentially the height ......
Read more >
Ditch the Carousel: Creating a Horizontal Scroll Effect - Medium
In this tutorial, we're going to look at how to build a component that temporarily changes the orientation of a user's scroll from...
Read more >
How to show or hide Horizontal & Vertical scroll bar in ...
Step 5: Checked or unchecked the Show Horizontal Scroll bar option and Show Vertical Scroll bar option according to your needs. See screenshot:...
Read more >
How to Add Vertical/Horizontal Scroll Bar in Classic Report ...
Today I will tell you how to add scroll bar vertical and horizontal in a classic report. I have created a classic Report...
Read more >
How do I remove the horizontal scrollbar in a div?
To hide the horizontal scrollbar, we can just select the scrollbar of the required div and set it to display ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found