You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got no answer on the community thread, so I'm trying here. I could not find similar issues on Github either.
If I leave the card alone (and let sort_by: state+ do its thing), It works. But if I click on the headers, I don't get the right sorting:
The "Distance" column sorts properly. The last one (which displays the age of the information) doesn't (even if I remove the prefix and show only numbers:
The sorting by price column doesn't work either if I remove sort_by: state+
I also tried sort_unmodified = true just in case: the behavior is the same
type: custom:flex-table-card
sort_by: state+
clickable: true
max_rows: 5
entities:
include:
- sensor.station_*SP98
columns:
- data: entity_picture
align: center
name: ""
modify: "'<img src=\"' + x + '\"style=\"height: 35px\">'"
- data: fuel_type
align: center
name: ""
icon: mdi:gas-station
- data: address,city
multi_delimiter: ", "
align: left
name: ""
- icon: mdi:currency-eur
data: state
name: ""
align: center
- data: distance
modify: x + " km"
name: Distance
- icon: mdi:calendar-clock
name: ""
data: days_since_last_update
align: center
prefix: J+
layout_options:
grid_columns: full
The text was updated successfully, but these errors were encountered:
It appears that column sorting requires a distinct name value. That's why the Distance column worked, whereas the other columns sorted the first column instead of the clicked column. So the workaround is to use names on the columns, instead of or with icons.
I will look into correcting this behavior in a future release, but I am not the code owner, so no guarantees.
It appears that column sorting requires a distinct name value. That's why the Distance column worked, whereas the other columns sorted the first column instead of the clicked column.
I don't know how you realized that but kudos!
So the workaround is to use names on the columns, instead of or with icons.
One single space works (and you can display the icon, so it looks identical). Since columns need a unique name, it seems two spaces work for the second column (and, I assume, three if you have a third one).
I will look into correcting this behavior in a future release, but I am not the code owner, so no guarantees.
I got no answer on the community thread, so I'm trying here. I could not find similar issues on Github either.
If I leave the card alone (and let
sort_by: state+
do its thing), It works. But if I click on the headers, I don't get the right sorting:The "Distance" column sorts properly. The last one (which displays the age of the information) doesn't (even if I remove the prefix and show only numbers:
The sorting by price column doesn't work either if I remove
sort_by: state+
I also tried
sort_unmodified = true
just in case: the behavior is the sameThe text was updated successfully, but these errors were encountered: