swimlane / ngx-datatable

✨ A feature-rich yet lightweight data-table crafted for Angular
http://swimlane.github.io/ngx-datatable/
MIT License
4.63k stars 1.68k forks source link

column pinning have some styling bugs #527

Open mburger81 opened 7 years ago

mburger81 commented 7 years ago

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 Showing your example for column pinning here http://swimlane.github.io/ngx-datatable/# in my opinion there is a style problem. The divider between City and State Header is not horizontal aligned with the divider in the rows.

image

Expected behavior I think the divider should be aligned.

Reproduction of the problem See the example in our demo page

Dedac commented 7 years ago

Any progress on this? you can still see the error in the live pinning demo

jguttman94 commented 7 years ago

There also seems to be an issue with pinned columns overriding the theme of the datatable. For example, I fetch my columns and rows from server and then I say, if this is a pinned column, create as pinned column in html, and for the rest of the columns, create in for loop. The pinned columns show up with white font and white background, where the rest of my columns are all themed correctly with black text and alternating row backgrounds.

mburger81 commented 7 years ago

Some news about this bug???

amcdnl commented 7 years ago

This is because the scrollbar is shown. I want to remove native scrollbars and use a solution like Facebook did here - https://facebook.github.io/fixed-data-table/

maxxt commented 7 years ago

Any news on this one?

mertergun commented 7 years ago

When there isn't the vertical scroll bar, you can see the below content, as shown in this image

xmeng1 commented 7 years ago

Yes, even there is no scroll bar, it is also not aligned. See #1078.
selection_055

xmeng1 commented 7 years ago

I found a best way or stupid way to solve the issue temporarily, when the view is changed, find all the element with the class: datatable-row-right datatable-row-group and add margin-left: 15px attributes.

public ngAfterViewChecked() {
    const elements: HTMLElement[] =
        this.elRef.nativeElement.getElementsByClassName('datatable-row-right datatable-row-group');
    if (elements && elements.length > 0) {
      for (const obj of elements) {
        obj.style.setProperty('margin-left', '15px');
      }
    }
  }
jkon commented 6 years ago

Similar issue I am seeing is that when using bootstrap or dark theme, pinned columns don't hide scrolled columns beneath like material theme does. You can see the issue by changing the theme on the pinning demo (http://swimlane.github.io/ngx-datatable/#pinning) using the dev console. If you change it to bootstrap, the middle columns scroll horizontally and you can still see them under the frozen columns screen shot 2017-11-22 at 3 09 00 pm

Also, the material striped theme loses the striping on the frozen columns: image

cmcclellen commented 6 years ago

Any updates on this? Any workarounds to allow striping of the rows, yet let the unpinned columns slide under the pinned ones like material?

The workaround I'm using with material is to define the row-even and row-odd styles, then set background-color: inherit on the .datatable-row-left.

i.e.: .datatable-row-even { background-color: $white; } .datatable-row-odd { background-color: $lightest-gray; } .datatable-body { .datatable-row-left { background-color: inherit; }

harsha-nagaraj commented 6 years ago

The above issue can be fixed by giving margin-left: -9px and use :host /deep/ to overwrite css on dataTable for the class screenshot from 2018-03-20 12-47-21

:host /deep/ .ngx-datatable.material .datatable-header .datatable-row-right{ margin-left: -8px; }

tonny008 commented 6 years ago

I created a pr for this bug #1524

HearnMichael commented 5 years ago

Any progress on this issue?

SanaeHanaoui commented 4 years ago

i have the same issue yet not solved i am using the version ^16.0.2

DSplawski92 commented 3 years ago

Similar issue I am seeing is that when using bootstrap or dark theme, pinned columns don't hide scrolled columns beneath like material theme does. You can see the issue by changing the theme on the pinning demo (http://swimlane.github.io/ngx-datatable/#pinning) using the dev console. If you change it to bootstrap, the middle columns scroll horizontally and you can still see them under the frozen columns screen shot 2017-11-22 at 3 09 00 pm

It seems issue still occurs. Is there any solution based on CSS?