muonw / muonw-powertable

▦ PowerTable is a Svelte component that turns JSON data into an interactive HTML table. Inspired by DataTables. Powered by Svelte.
https://muonw.github.io/muonw-powertable/
Other
220 stars 13 forks source link

Specify column for default sort? #32

Open powellnorma opened 1 year ago

powellnorma commented 1 year ago

I think currently the way to do this is to presort the ptData before passing it to PowerTable? But since we already have implemented the sorting logic (maybe even with custom customSort functions) it would be great if we could reuse it

muonw-public commented 1 year ago

I think currently the way to do this is to presort the ptData before passing it to PowerTable?

Correct!

since we already have implemented the sorting logic (maybe even with custom customSort functions) it would be great if we could reuse it

Good idea! To avoid breaking the multi-column sorting functionality, we also need to keep track of the order of sorting as suggested in https://github.com/muonw/muonw-powertable/issues/4