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

Pre-populate filters on the pivottable #1236

Open madgi444 opened 4 years ago

madgi444 commented 4 years ago

Hi there,

I'm usign the vue-pivotable and I'ld like to know how to prepopulate the filters before render. I saw the documentation "valueFilter" and it looks that is exactly what I need but I can't make it work. my code is: <vue-pivottable-ui :data="data" :aggregator-name="aggregatorName" :renderer-name="rendererName" :rows="rows" :cols="cols" :vals="vals" :row-total="true" :col-total="true" :hidden-from-drag-drop="hiddenFromDragDrop" :disabled-from-drag-drop="disabledFromDragDrop" :hidden-from-aggregators="valueAggr" :value-filter="valueFilter" /> I have a field called "name" and can have 3 values (K,P and N) I tried fill a variable like I list below this.valueFilter = { name: [{ 'K': false }, { 'N': true }, {' P': false }] }

My question is if there is a way to do it and what am I doing wrong

Kind regards Maria

alunacob commented 2 years ago

I am looking at this same feature, although I don't seem to find the "valueFilter" in the documentation.

nicolaskruchten commented 2 years ago

The parameters you're looking for are inclusions and exclusions in the docs here https://github.com/nicolaskruchten/pivottable/wiki/Parameters