ngx-datatable: column pinning have some styling bugs

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

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Comments: 15 (1 by maintainers)

Commits related to this issue

Most upvoted comments

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?

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

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');
      }
    }
  }

Any progress on this issue?

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; }

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; }

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