nicolaskruchten / pivottable

Open-source Javascript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation with drag'n'drop.
https://pivottable.js.org/
MIT License
4.36k stars 1.08k forks source link

altering sorting of keys #868

Open karelv opened 6 years ago

karelv commented 6 years ago

I would like to sort the row-keys based on the average values of one field of the records matching that row. Same goes for the col-keys.

karelv commented 6 years ago

Same as my previous issue I created, I created also a solution for this one... The result is this: image

However here I had to tweak a bit more in the pivot.js file. https://github.com/karelv/pivottable/blob/master/dist/pivot.js

And the example from the above screenshot: https://github.com/karelv/pivottable/blob/master/examples/mps_category_table_alter_key_order.html

From last issue I know that you want coffee script, but is there a way I can add this kind of function without touching the original pivot.js?

nicolaskruchten commented 6 years ago

I'm sorry, I don't understand the question I can help answer here...