Dataview table, sort with buttons

Hi, I’m trying to create a note that includes 4 buttons and a dataview table

This table is sorted according to which button is pressed.


The idea was to use the button to change to line x of the dataview query the line containing the sort command, with the following sequence:


```button
name Azienda ↑
type line(70) text
action SORT company asc 
replace [70,70]
templater true

Unfortunately, it doesn’t work.

best regards

There are plugins capable of sorting html tables by clicking the headers, which most likely is a better alternative than changing the query itself.

If changing the query you also need to refresh the view somehow, to make it redo the query.

The plugin I’m using is Sortable. It works like a charm for all types of tables — I mean ordinary tables as well as Dataview’s .

1 Like