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

Sorting Options #33

Open
jhemak opened this issue Feb 2, 2024 · 3 comments
Open

Sorting Options #33

jhemak opened this issue Feb 2, 2024 · 3 comments

Comments

@jhemak
Copy link

jhemak commented Feb 2, 2024

Is there a way to specify two fields to sort on? For example, first by availability and then by name? I have tried various ways but have not been able to get that to work. Thank you!

@StancuFlorin
Copy link

@jhemak
Copy link
Author

jhemak commented Apr 9, 2024

Thanks, I came across that earlier but it doesn't seem to work for me. Do you have a working example?

This works ... in alphabetical order

clickable: true
columns:
  - name: Name
    prop: name
  - attr: available
    id: available
    modify: x || "false"
    name: Online
  - attr: rssi
    name: RSSI
  - name: NWK
    prop: nwk
sort_by: 
  - name
type: custom:zha-network-card

This works ... in numeric order from worst connection to best

clickable: true
columns:
  - name: Name
    prop: name
  - attr: available
    id: available
    modify: x || "false"
    name: Online
  - attr: rssi
    name: RSSI
  - name: NWK
    prop: nwk
sort_by: 
  - rssi
type: custom:zha-network-card

This does not ... neither alphabetical on name nor in numeric order on RSSI ... seems essentially a random order.

clickable: true
columns:
  - name: Name
    prop: name
  - attr: available
    id: available
    modify: x || "false"
    name: Online
  - attr: rssi
    name: RSSI
  - name: NWK
    prop: nwk
sort_by: 
  - rssi
  - name
type: custom:zha-network-card

@jhemak
Copy link
Author

jhemak commented May 29, 2024

@StancuFlorin just circling back here - any idea what I am doing wrong? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants