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

How to get the Filtered Values and pass it to a jQuery method #626

Closed nithishanf closed 7 years ago

nithishanf commented 7 years ago

Hi Nicholas,

Thanks for the Pivottable.js .It is just amazing .

I need a help. I have to create an excel export of the Base File based on the filtered values input. Please Note: Not the Pivot Table,but the Original Data File with all the columns but filtered according to the filter values applied.

How can I get all the filtered values from the filter option?

If I can get the filtered values, I am thinking of passing it as a string via jquery to the backend and form a new table and call that table on an Export button click.

nicolaskruchten commented 7 years ago

You can use the onRefresh parameter to define a function which is called every time the user interacts with the pivot UI. See the example here: http://nicolas.kruchten.com/pivottable/examples/onrefresh.html

nithishanf commented 7 years ago

Thanks a lot..!! Can I export the Pivot Table("table.pvtTable") as well with this plugin? Or have to find a work around?

nicolaskruchten commented 7 years ago

No, this mechanism is unrelated to exporting.

ErickPol commented 2 years ago

The stack overflow post below and respective jsfiddle may help anyone looking for a solution: https://stackoverflow.com/questions/73625787/how-to-access-filtered-data-from-pivottable-js https://jsfiddle.net/90q26d87/1/