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

Sorting not working with custom templates when classes are introduced conditionaly #1283

Open PrashansaM-optimus opened 6 years ago

PrashansaM-optimus commented 6 years ago

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

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

Current behavior On conditionally adding a few classes for styling purposes to custom templates, sorting does not work as expected.

With above custom template, the class 'c-highlight' will be added to the span tag when the corresponding value is greater than 10.

On sorting the columns, the sorting does not work as expected. It looks that sorting is applied considering the span tag with its content, and not on the value inside the span tag.

Expected behavior Sorting should work only on values

Reproduction of the problem Explained above

What is the motivation / use case for changing the behavior? Some cells should be highlighted depending upon their value and sorting should work on values alone

Please tell us about your environment: Windows 10, Visual Studio Code, npm

Matmo10 commented 6 years ago

Your template code isn't showing.

kabb5 commented 6 years ago

@PrashansaM-optimus do you have your code that you could provide here? Based on your description, I think I am having the same or at least a similar issue