Ngx-datatable: column pinning have some styling bugs

Created on 16 Feb 2017  路  15Comments  路  Source: swimlane/ngx-datatable

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

Investigate

Most helpful comment

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

All 15 comments

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

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.

Some news about this bug???

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/

Any news on this one?

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

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

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

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

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

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

I created a pr for this bug #1524

Any progress on this issue?

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

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

id1945 picture id1945  路  3Comments

eddy-geek picture eddy-geek  路  3Comments

iget-esoares picture iget-esoares  路  3Comments

devendraYebhi picture devendraYebhi  路  3Comments

Csirme picture Csirme  路  3Comments