Skip to content

About table sorting #136

alexandru-dinu started this conversation in Ideas
About table sorting #136
Apr 23, 2021 · 3 comments · 3 replies

Hello Michael,

I just noticed that "table sorting" is listed under your roadmap.

I am developing obsidian-sortable, a simple plugin to achieve this, and I thought about the possibility of merging the plugin's functionality into dataview, in order to keep things consistent; especially with the latest release that brought auto refresh (see this issue).

A middle ground solution may be to make sortable a dependency of dataview, so that people that don't use dataview will not lose table sorting.

What do you think?

Thank you,
Alex

Replies

3 comments
·
3 replies

Does obsidian-sortable just operate on HTML tables? If so, would be happy to see about integrating it in a smart way (since dataview already has a pretty good internal sort algorithm).

1 reply
@alexandru-dinu

Does obsidian-sortable just operate on HTML tables?

Yes, it simply reorders table rows (tr elements) based on the column data of the clicked header.

[...] integrating it in a smart way (since dataview already has a pretty good internal sort algorithm).

What do you think it's the best way to do it? The plugin has no additional dependencies (other than the ones required by Obsidian), so it should be straightforward to integrate it.

Thanks!

Any updates on this? It's been a while.

2 replies
@blacksmithgu

It might be revisited in the near future since dynamic table column sorting is coming, though Dataview now has a relatively robust internal sorting mechanism so I'm not sure yet.

@alexandru-dinu

Come to think of it, it's better to have Sortable and Dataview as separate plugins. One option is to let users sort Dataview tables using your own mechanism, and I can add a setting to ignore Dataview tables for this case (i.e. let Sortable operate only on "vanilla" tables).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
4 participants