Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dataTable#rowStyleClass mess up with row styles #1827

Closed
borovsky opened this issue Jan 17, 2017 · 2 comments
Closed

dataTable#rowStyleClass mess up with row styles #1827

borovsky opened this issue Jan 17, 2017 · 2 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@borovsky
Copy link

I'm submitting a ... (check one with "x")

[X] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.

http://embed.plnkr.co/9eOs9R5GrAApHR0q3m8i/

Current behavior
rowStyleClass mess up with styles, e.g. it possible to have inconsistent styles: ui-datatable-even ui-datatable-odd in the same time, ui-state-highlight if no selectable rows

Expected behavior
rowStyleClass correctly generate class attribute

Minimal reproduction of the problem with instructions
In plunk, change one of the columns to match other column in the same row (triggers row class change).
When row class changes, class list for row became inconsistent (even and odd class, highlight, etc)

  • Angular version: 2.4.3

  • PrimeNG version: 1.1.4

  • Browser: all

  • Language: all

  • Node (for AoT issues): node --version =

@laserus
Copy link
Contributor

laserus commented Apr 24, 2017

I have faced the same and thought that it could be due to usage of [class] and [ngClass] in the same element. Fixed this with moving rule for [class] to ngClass, and unfortunately [ngClass] cannot work as this:

[ngClass]="{'my-class': condition, [dt.getRowStyle(rowData, index)]:true}"

See here http://stackoverflow.com/a/37091299/5851804. Thus, I had to change the ngClass to array of classnames.

Added PR.

@cagataycivici cagataycivici added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Jun 19, 2017
laserus added a commit to laserus/primeng that referenced this issue Aug 10, 2017
cagataycivici added a commit that referenced this issue Aug 10, 2017
@cagataycivici cagataycivici self-assigned this Aug 10, 2017
@cagataycivici cagataycivici added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Aug 10, 2017
@cagataycivici cagataycivici added this to the 4.1.3 milestone Aug 10, 2017
@cagataycivici
Copy link
Member

Fixed via PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

3 participants