custom-cards / flex-table-card

Highly Flexible Lovelace Card - arbitrary contents/columns/rows, regex matched, perfect to show appdaemon created content and anything breaking out of the entity_id + attributes concept
GNU General Public License v3.0
198 stars 23 forks source link

Ability to sort_by column with modify data #82

Closed istvnurbn closed 1 year ago

istvnurbn commented 1 year ago

Hi,

I have sensors which are spitting out information like this:

Screenshot 2022-08-04 at 17 25 11

I have the information populated on the card like so:

Screenshot 2022-08-04 at 17 31 09

As you can see the departure times are a bit jumbled and I would like to sort the table based on that. However the only data I have is vehicles from which I extract the departure time with the modify option:

type: custom:flex-table-card
sort_by: vehicles
max_rows: 8
entities:
  include:
    - sensor.bkk_fay_to_downtown_buses
    - sensor.bkk_fay_to_downtown_tram
columns:
  - name: Route
    data: vehicles
    modify: x.routeid
  - name: Where
    data: vehicles
    modify: x.headsign
  - con: mdi:clock
    name: Departure
    align: right
    data: vehicles
    modify: x.in + 'm' + ' | ' + x.attime

So it would be great if you could add the ability to sort data based on the modify option of a given column.

istvnurbn commented 1 year ago

Well this is pointless after all, as you can add the id option to a column and you can sort based on that.